Sha256: 79a55c1d161d817e952e7f7c4bc1546362fa7afb08377070597bee69c7627dc5

Contents?: true

Size: 1.78 KB

Versions: 5

Compression:

Stored size: 1.78 KB

Contents

// 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 self = this;
			var wrapper = dom.div(['entry-wrap page no-boxes', self.alias_class(), self.fields_class(), self.depth_class(), self.visibility_class()]);
			var contents = dom.div('.entry-contents');
			var inside = dom.div('.entry-inner');
			var outline = dom.div('.white-bg').mouseover(self.mouseover.bind(self)).mouseout(self.mouseout.bind(self)).click(self.edit.bind(self));
			inside.append(outline);
			contents.append(self.action_buttons(contents));
			if (self.content.type().is_alias()) {
				contents.append(self.alias_target_panel());
			} else {
				contents.append(self.page_title_panel());
			}

			var entry = dom.div('.entry');
			var fields = new Spontaneous.FieldPreview(self, '', true);
			var fields_panel = fields.panel();
			entry.append(fields_panel);
			inside.append(entry);
			var preview_area = self.create_edit_wrapper(inside);
			contents.append(preview_area);
			wrapper.append(contents, self.entry_spacer());
			self.wrapper = wrapper;
			self.outline = outline;
			self.fields_preview = fields_panel;
			return wrapper;
		},
		page_title_panel: function() {
			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));

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
spontaneous-0.2.0.beta10 application/js/views/page_piece_view.js
spontaneous-0.2.0.beta9 application/js/views/page_piece_view.js
spontaneous-0.2.0.beta8 application/js/views/page_piece_view.js
spontaneous-0.2.0.beta7 application/js/views/page_piece_view.js
spontaneous-0.2.0.beta6 application/js/views/page_piece_view.js