From b47e362f1a07eac7252c0c0f1938130c0fc2a045 Mon Sep 17 00:00:00 2001 From: Anon Ray Date: Tue, 5 Mar 2013 21:35:45 +0530 Subject: [PATCH] Fix title undefined in content or page Looks like the fix was not pushed in the last commit which was mentioned. Pushing the fix now. --- 404.html | 4 ---- js/mouchak.js | 11 +++++++++-- js/plugins.js | 9 ++++++++- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/404.html b/404.html index 0446544..71ce557 100644 --- a/404.html +++ b/404.html @@ -148,10 +148,6 @@
  • a mistyped address
  • an out-of-date link
  • - - diff --git a/js/mouchak.js b/js/mouchak.js index 39b785b..cb0154e 100644 --- a/js/mouchak.js +++ b/js/mouchak.js @@ -28,7 +28,8 @@ var TextView = Backbone.View.extend({ }, render: function(el) { $(el).append(this.el); - var str = '

    '+ this.model.get('title') +'

    ' + + var title = this.model.get('title') || ''; + var str = '

    '+ title +'

    ' + this.model.get('data') + '

    '; $(this.el).html(str); M.appendAttrs(this.model, this.el); @@ -307,6 +308,7 @@ var AppView = Backbone.View.extend({ var children = model.get('children'); if(_.isEmpty(children)) { li = '
  • ' + M.humanReadable(child) + '
  • '; + console.log(li); } else { li = dropdown_template({ @@ -314,7 +316,9 @@ var AppView = Backbone.View.extend({ list: _.map(children, M.humanReadable) }); } - $(li).appendTo('#nav-' + page + ' .nav'); + console.log($('#nav-' + page + ' .nav')); + //$(li).appendTo('#nav-' + page + ' .nav'); + $('#nav-'+page+' .nav').append(li); }); }, updateBreadcrumbs: function(event) { @@ -495,4 +499,7 @@ M.load = function(content_url) { }); }; +// export BaseType to the M namespace +M.BaseType = BaseType; + })(M); diff --git a/js/plugins.js b/js/plugins.js index c6df4b2..2afb281 100644 --- a/js/plugins.js +++ b/js/plugins.js @@ -11,4 +11,11 @@ if (!(window.console && console.log)) { }()); } -// Place any jQuery/helper plugins in here. +(function(M) { + M.jsonEditor = { + edit: function() { + _.each(M.pages.models, function(page) { + }); + } + }; +})(M); -- 1.7.10.4