Skip to content

Commit

Permalink
Add buttons need a class
Browse files Browse the repository at this point in the history
  • Loading branch information
bergie committed Dec 21, 2011
1 parent 317ab79 commit 7d0d5b7
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/jquery.Midgard.midgardEditable.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,20 @@
this.enable();
},

enable: function() {
enable: function() {
var widget = this;
this.vie.RDFa.findPredicateElements(this.options.model.id, jQuery('[property]', this.element), false).each(function() {
return widget._enableProperty(jQuery(this));
});
this._trigger('enable', null, {
instance: this.options.model,
entityElement: this.element
});
_.forEach(this.vie.services.rdfa.views, function(view) {
if (view instanceof widget.vie.view.Collection) {
widget._enableCollection(view);
}
});

this._trigger('enable', null, {
instance: this.options.model,
entityElement: this.element
});
},

disable: function() {
Expand Down Expand Up @@ -134,7 +133,6 @@
entityElement: widget.element
});
});

this._trigger('enableproperty', null, {
editable: null,
property: propertyName,
Expand Down Expand Up @@ -223,6 +221,7 @@
});

widget.options.addButton = jQuery('<button>Add</button>').button();
widget.options.addButton.addClass('midgard-create-add');
widget.options.addButton.click(function() {
collectionView.collection.add({});
});
Expand Down

0 comments on commit 7d0d5b7

Please sign in to comment.