Permalink
Browse files

- add support for data-popup

  • Loading branch information...
1 parent e794e1f commit eb9df9340cea96763b3907d57f6b3f7730f2615a @dguettler committed Nov 8, 2012
Showing with 11 additions and 0 deletions.
  1. +11 −0 vendor/assets/javascripts/prototype_ujs.js
View
11 vendor/assets/javascripts/prototype_ujs.js
@@ -161,6 +161,17 @@
}
});
+ document.on("click", "a[data-popup]", function(event, element) {
+ if (event.stopped) return;
+ if ((data = element.readAttribute('data-popup')) != '') {
+ options = data.split(';');
+ window.open($(element).href, options[0], options[1]);
+ } else {
+ window.open($(element).href);
+ }
+ event.stop();
+ });
+
document.on("click", "form input[type=submit], form button[type=submit], form button:not([type])", function(event, button) {
// register the pressed submit button
event.findElement('form').store('rails:submit-button', button.name || false);

0 comments on commit eb9df93

Please sign in to comment.