Commit 42487584 by Chris Dodge

remove cut/paste error which results in a server error. is not defined when…

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
parent d80c8340
......@@ -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() {
......
......@@ -99,7 +99,7 @@
</div>
<div class="embeddable">
<label>Embeddable XML:</label>
<input type="text" class="embeddable-xml-input" value='<img src="${asset['url']}"/>'>
<input type="text" class="embeddable-xml-input" value='<img src=""/>'>
</div>
<form class="file-chooser" action="${upload_asset_callback_url}"
method="post" enctype="multipart/form-data">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment