app/assets/javascript/pageflow/linkmap_page/editor/models/area.js in pageflow-linkmap-page-0.2.0 vs app/assets/javascript/pageflow/linkmap_page/editor/models/area.js in pageflow-linkmap-page-1.0.0
- old
+ new
@@ -59,9 +59,45 @@
label: function() {
return this.get('name');
},
+ select: function() {
+ this.trigger('select', this);
+ },
+
+ selectMask: function() {
+ var model = this;
+
+ return pageflow.linkmapPage.selectArea(
+ this.collection.page,
+ {type: 'mask'}
+ ).then(function(attributes) {
+ model.set(_.extend(attributes, {
+ marker: 'no_marker'
+ }));
+ model.trigger('change:dimensions');
+ });
+ },
+
+ unsetMask: function() {
+ this.set({
+ marker: 'no_marker',
+ mask_perma_id: undefined
+ });
+ this.trigger('change:dimensions');
+ },
+
+ setDimensions: function(left, top, width, height) {
+ this.set({
+ left: left,
+ top: top,
+ width: width,
+ height: height
+ });
+ this.trigger('change:dimensions');
+ },
+
highlight: function() {
this.set('highlighted', true);
},
resetHighlight: function() {