Skip to content

Commit c72da34

Browse files
committed
optimisation for modal element fadeout effect
do not require form 'element' parameter to modals
1 parent 8f3d756 commit c72da34

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

js/libs/modal/modal.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ define(['jquery', 'autogrow', 'mustache', 'form', 'text!templates/modals/inlinee
8080

8181
// bind form controller if one is specified in options
8282
if (options.form) {
83-
this.form = FormFactory.create($(options.form.element, this.el), options.form.model, options.form);
83+
this.form = FormFactory.create($(options.form.element || 'form.inline-edit', this.el), options.form.model, options.form);
8484
}
8585
// otherwise, bind submit event for inline modals
8686
else if (options.inline && options.inline.model && options.inline.field) {
@@ -155,10 +155,9 @@ define(['jquery', 'autogrow', 'mustache', 'form', 'text!templates/modals/inlinee
155155
};
156156

157157
modal.prototype.hide = function (animation) {
158-
var that = this;
159-
this.el.fadeOut(200);
160-
this.overlay.fadeOut(200, function () {
161-
158+
var that = this,
159+
els = $().add(this.el).add(this.overlay);
160+
els.fadeOut(200, function () {
162161
that.el.remove();
163162
that.overlay.remove();
164163
delete that.form;

0 commit comments

Comments
 (0)