From f4147dfad51ecacca61467564f6b4790114abd10 Mon Sep 17 00:00:00 2001 From: Anon Ray Date: Wed, 15 Jan 2014 20:52:31 +0530 Subject: [PATCH] Few editor changes - Site Menu configuration now has a HTML code editor, instead of a dummy textbox like before. - Page list overflowing is fixed by adding a scroll to it. --- mouchak/static/css/editor.css | 7 ++++++- mouchak/static/js/editor.js | 19 ++++++++++++++++--- mouchak/templates/editor.html | 5 +++-- 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/mouchak/static/css/editor.css b/mouchak/static/css/editor.css index 79ea8c9..1bcc1b4 100644 --- a/mouchak/static/css/editor.css +++ b/mouchak/static/css/editor.css @@ -33,6 +33,8 @@ body { } #pagelist { padding: 10px; + height: 300px; + overflow-y: auto; } #content { padding: 10px; @@ -79,7 +81,10 @@ body { top: 0; left: 0; width: 100%; - height: 500px; + height: 300px; +} +#updateMenu { + margin-top: 10px; } #editor-overlay { position: absolute; diff --git a/mouchak/static/js/editor.js b/mouchak/static/js/editor.js index 4a0d9b6..3876cf1 100644 --- a/mouchak/static/js/editor.js +++ b/mouchak/static/js/editor.js @@ -10,6 +10,7 @@ 'click #addPage': 'addPage', 'click .pagename .remove': 'removePage', 'click #menu-config': 'showMenu', + 'click #footer-config': 'showFooterConfig' }, initialize: function() { _.bindAll.apply(_, [this].concat(_.functions(this))); @@ -82,7 +83,14 @@ M.editor.showOverlay(); }, showMenu: function(event) { + event.preventDefault(); this.menuconfigview.render(); + return false; + }, + showFooterConfig: function(event) { + event.preventDefault(); + //this.footerconfigview.render(); + return false; }, // validate the page list with menu order list validate: function() { @@ -485,7 +493,7 @@ this.$menuOrder.hide(); $('#custom-menu').attr('checked', true); this.$menuOptions.show({complete: function() { - //M.editor.wysiwig('#menu'); + M.editor.code.init('menu', 'html'); }}); } }, @@ -493,7 +501,7 @@ if(bool === true) { this.$menuOrder.hide(); this.$menuOptions.show({complete: function() { - //M.editor.wysiwig('#menu'); + M.editor.code.init('menu', 'html'); }}); } else { @@ -514,7 +522,8 @@ saveMenu: function() { //console.log('saving menu..'); if($('#custom-menu').is(':checked')) { - var html = $('#menu').val().trim() || ''; + //var html = $('#menu').val().trim() || ''; + var html = M.editor.code.save('menu'); this.model.set({'customMenu': true, 'html': html}); } else { @@ -540,6 +549,10 @@ } }); + /* Footer Config View */ + var FooterConfigView = Backbone.View.extend({ + }); + /* Notification view */ var NotificationView = Backbone.View.extend({ initialize: function(opts) { diff --git a/mouchak/templates/editor.html b/mouchak/templates/editor.html index 0249ff5..f1fea45 100644 --- a/mouchak/templates/editor.html +++ b/mouchak/templates/editor.html @@ -93,7 +93,7 @@
- +
@@ -112,7 +112,8 @@

-

Site Menu

+

Site Menu

+

Footer Config

Go to site

-- 1.7.10.4