From 424875848eba21cb8aefa09fe9b44b94ec720e80 Mon Sep 17 00:00:00 2001 From: Chris Dodge Date: Thu, 18 Oct 2012 21:57:06 -0400 Subject: [PATCH] remove cut/paste error which results in a server error. is not defined when there are no assets. Also fix up base.js to only register one set of handlers for file section which gets rid of the multiple file selection dialogs from appearing --- cms/static/js/base.js | 9 +++++---- cms/templates/asset_index.html | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) 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 @@
- '> +