application/js/views/page_piece_view.js in spontaneous-0.2.0.alpha2 vs application/js/views/page_piece_view.js in spontaneous-0.2.0.alpha3

- old
+ new

@@ -1,19 +1,20 @@ // console.log('Loading PageEntry...') Spontaneous.Views.PagePieceView = (function($, S) { + "use strict"; var dom = S.Dom; var PagePieceView = new JS.Class(Spontaneous.Views.PieceView, { // will eventually overwrite panel() panel: function() { var wrapper = dom.div(['entry-wrap page no-boxes', this.depth_class(), this.visibility_class()]) var contents = dom.div('.entry-contents'); var inside = dom.div('.entry-inner'); var outline = dom.div('.white-bg').mouseover(this.mouseover.bind(this)).mouseout(this.mouseout.bind(this)).click(this.edit.bind(this)) inside.append(outline) - contents.append(this.title_bar(contents)); + contents.append(this.action_buttons(contents)); if (this.content.type().is_alias()) { contents.append(this.alias_target_panel()); } contents.append(this.page_title_panel()); @@ -29,16 +30,18 @@ this.outline = outline; this.fields_preview = fields_panel; return wrapper; }, page_title_panel: function() { - var wrapper = dom.div('.page-title'), - __content = this, - title = dom.a().html(this.content.title()).click(function() { - S.Location.load_id(__content.id()); - }); - this.content.title_field().watch('value', function(t) { title.text(t); }.bind(this)); - wrapper.append(title); + var wrapper = dom.div('.page-title').click(function() { + S.Location.load_id(self.id()); + }), + self = this, + content = self.content, + title = dom.a().html(this.content.title()), + type = dom.span(".content-type").text(content.type().display_title(content)); + this.content.title_field().watch('value', function(t) { title.html(t); }.bind(this)); + wrapper.append(title, type); return wrapper; } }); return PagePieceView; }(jQuery, Spontaneous));