From 2998a3dbf63e3f61cae27745a7c1375951901a03 Mon Sep 17 00:00:00 2001 From: Arvind Date: Mon, 22 Jul 2013 14:52:18 +0530 Subject: [PATCH] Bug fixes: - Closing ticket #5 http://trac.pantoto.org/mouchak/ticket/5. - Custom menu interface was not checking if the option for custom menu was checked or not. Fixing that. - Adding virtualenv entries in .gitignore --- .gitignore | 6 +++++- static/js/editor.js | 17 ++++++++++++----- templates/editor.html | 20 ++++++++++---------- 3 files changed, 27 insertions(+), 16 deletions(-) diff --git a/.gitignore b/.gitignore index 2538ed7..7670641 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ - *.*~ *.pyc +# For virtual-env +bin/ +lib/ +local/ +include/ \ No newline at end of file diff --git a/static/js/editor.js b/static/js/editor.js index 1c5bbed..a6001e6 100644 --- a/static/js/editor.js +++ b/static/js/editor.js @@ -257,13 +257,13 @@ })); // init the wysiwig editor M.editor.wysiwig('#edit'); - } + } else if(type === 'image' || type === 'video' || type === 'audio') { var template = _.template($('#media-template').html()); $('#specific-content').html(template({ src: this.model.get('src') })); - + //provide the users a preview /*var view = new M.types.view[type]({model: this.model}); //$('#specific-content.preview').html(); @@ -359,18 +359,25 @@ this.showMenuOptions(this.model.get('customMenu')); }, saveMenu: function() { - //console.log('saving menu..'); + console.log('saving menu..'); // var menuHTML = $('#menu').val().trim(); //this.model.set({'html': menuHTML}); //console.log(this.model.toJSON()); //alert('saveMenu called'); - /*this.model.save({}, { + var bool; + if($("custom-menu").is(":checked")){ + bool = true; + } + else{ + bool = false; + } + this.model.save({customMenu: bool}, { success: function(model, response) { console.log(model, response); }, error: function(xhr, response) { } - });*/ + }); //alert('end of save menu'); } }); diff --git a/templates/editor.html b/templates/editor.html index 25067cb..d71ca58 100644 --- a/templates/editor.html +++ b/templates/editor.html @@ -28,7 +28,7 @@ - + @@ -124,7 +124,7 @@ Children - +
@@ -146,9 +146,9 @@