Permalink
Browse files

Improved dialog events with event arguments

Added command, dialogElement and link to the event argument being
passed to the show:dialog, save:dialog and cancel:dialog events.
  • Loading branch information...
1 parent 2d685dd commit 23e09fbba45423c9e13b788e70cb5f1441039c68 @martinnormark martinnormark committed Dec 2, 2011
Showing with 197 additions and 193 deletions.
  1. +5 −0 dist/wysihtml5-0.2.0.js
  2. +188 −190 dist/wysihtml5-0.2.0.min.js
  3. +4 −3 src/toolbar/toolbar.js
View
@@ -7673,6 +7673,8 @@ wysihtml5.views.Textarea = wysihtml5.views.View.extend(
dialog.observe("show", function() {
caretBookmark = wysihtml5.selection.getBookmark(sandboxDoc);
+
+ that.editor.fire("show:dialog", { command: command, dialogContainer: dialogElement, commandLink: link });
});
dialog.observe("save", function(attributes) {
@@ -7682,10 +7684,13 @@ wysihtml5.views.Textarea = wysihtml5.views.View.extend(
wysihtml5.selection.setBookmark(caretBookmark);
}
that._execCommand(command, attributes);
+
+ that.editor.fire("save:dialog", { command: command, dialogContainer: dialogElement, commandLink: link });
});
dialog.observe("cancel", function() {
that.editor.focus(false);
+ that.editor.fire("cancel:dialog", { command: command, dialogContainer: dialogElement, commandLink: link });
});
}
return dialog;
Oops, something went wrong.

0 comments on commit 23e09fb

Please sign in to comment.