Committer: vkurkin
LJSUP-10284: Fotki: ability to set images sequence with adding to an entryU trunk/htdocs/js/entry.js
Modified: trunk/htdocs/js/entry.js =================================================================== --- trunk/htdocs/js/entry.js 2011-11-09 06:57:30 UTC (rev 20506) +++ trunk/htdocs/js/entry.js 2011-11-09 06:58:35 UTC (rev 20507) @@ -989,16 +989,37 @@ }); }; -InOb.handleInsertImageBeta = function (){ - jQuery('#updateForm').photouploader('option', 'type', 'upload').bind('htmlready', - function (event, htmlOutput){ +InOb.handleInsertImageBeta = function () { + var jSortable, + jPhotoUploader = jQuery('#updateForm'); + + jPhotoUploader.photouploader('option', 'type', 'upload').bind('htmlready', + function (event) { var selection = DOM.getSelectedRange($('draft')); - var node = $('draft').event; + var node = $('draft'); var value = node.value; var start = value.substring(0, selection.start); var end = value.substring(selection.end); - node.value = start + htmlOutput + end; + node.value = start + event.htmlStrings.join('') + end; + }).bind('endupload', function() { + jSortable.sortable('enable').sortable('refresh'); + }).bind('uploading', function() { + jSortable.sortable('disable'); + }).bind('removeitem', function () { + jSortable.sortable('refresh'); }).photouploader('show'); + + jSortable = jQuery('.b-popup-pics-gallery-list'); + jSortable.sortable({ + axis: 'x', + disabled: true, + stop: function() { + jPhotoUploader.photouploader('update'); + } + }); + + jSortable.disableSelection(); + return true; };