diff --git a/cms/static/js/base.js b/cms/static/js/base.js index af90a3cf3a..399049bba2 100644 --- a/cms/static/js/base.js +++ b/cms/static/js/base.js @@ -86,6 +86,11 @@ $(document).ready(function() { $('.set-publish-date').bind('click', setSectionScheduleDate); $('.edit-section-start-cancel').bind('click', cancelSetSectionScheduleDate); $('.edit-section-start-save').bind('click', saveSetSectionScheduleDate); + + // modal upload asset dialog. Bind it in the initializer otherwise multiple hanlders will get registered causing + // pretty wacky stuff to happen + $('.file-input').bind('change', startUpload); + $('.upload-modal .choose-file-button').bind('click', showFileSelectionMenu); }); function showImportSubmit(e) { @@ -304,8 +309,6 @@ function _deleteItem($el) { function showUploadModal(e) { e.preventDefault(); $('.upload-modal').show(); - $('.file-input').bind('change', startUpload); - $('.upload-modal .choose-file-button').bind('click', showFileSelectionMenu); $modalCover.show(); } @@ -358,8 +361,6 @@ function displayFinishedUpload(xhr) { var html = Mustache.to_html(template, resp); $('table > tbody > tr:first').before(html); - $("tr[data-id='" + resp.url + "'] a.show-xml").toggle(showEmbeddableXML, hideEmbeddableXML); - } function markAsLoaded() { diff --git a/cms/templates/asset_index.html b/cms/templates/asset_index.html index 53b4c6d71a..83e2188691 100644 --- a/cms/templates/asset_index.html +++ b/cms/templates/asset_index.html @@ -99,7 +99,7 @@
- '> +