]> source.dussan.org Git - jquery-ui.git/commitdiff
Widget factory: Force event types to be lowercase. Fixes #4668 - All event types...
authorScott González <scott.gonzalez@gmail.com>
Sat, 11 Jul 2009 00:30:46 +0000 (00:30 +0000)
committerScott González <scott.gonzalez@gmail.com>
Sat, 11 Jul 2009 00:30:46 +0000 (00:30 +0000)
tests/unit/dialog/dialog_events.js
ui/ui.core.js

index 4602921f9e62c2cf38d983b9791a82033fc9440e..805bbd53504063ea54257598aaa876edebdf24e1 100644 (file)
@@ -44,11 +44,11 @@ test("dragStart", function() {
                dragStart: function(ev, ui) {
                        ok(true, 'dragging fires dragStart callback');
                        equals(this, el[0], "context of callback");
-                       equals(ev.type, 'dialogdragStart', 'event type in callback');
+                       equals(ev.type, 'dialogdragstart', 'event type in callback');
                        same(ui, {}, 'ui hash in callback');
                }
-       }).bind('dialogdragStart', function(ev, ui) {
-               ok(true, 'dragging fires dialogdragStart event');
+       }).bind('dialogdragstart', function(ev, ui) {
+               ok(true, 'dragging fires dialogdragstart event');
                equals(this, el[0], 'context of event');
                same(ui, {}, 'ui hash in event');
        });
@@ -89,11 +89,11 @@ test("dragStop", function() {
                dragStart: function(ev, ui) {
                        ok(true, 'dragging fires dragStop callback');
                        equals(this, el[0], "context of callback");
-                       equals(ev.type, 'dialogdragStop', 'event type in callback');
+                       equals(ev.type, 'dialogdragstop', 'event type in callback');
                        same(ui, {}, 'ui hash in callback');
                }
-       }).bind('dialogdragStop', function(ev, ui) {
-               ok(true, 'dragging fires dialogdragStop event');
+       }).bind('dialogdragstop', function(ev, ui) {
+               ok(true, 'dragging fires dialogdragstop event');
                equals(this, el[0], 'context of event');
                same(ui, {}, 'ui hash in event');
        });
@@ -109,11 +109,11 @@ test("resizeStart", function() {
                resizeStart: function(ev, ui) {
                        ok(true, 'resizing fires resizeStart callback');
                        equals(this, el[0], "context of callback");
-                       equals(ev.type, 'dialogresizeStart', 'event type in callback');
+                       equals(ev.type, 'dialogresizestart', 'event type in callback');
                        same(ui, {}, 'ui hash in callback');
                }
-       }).bind('dialogresizeStart', function(ev, ui) {
-               ok(true, 'resizing fires dialogresizeStart event');
+       }).bind('dialogresizestart', function(ev, ui) {
+               ok(true, 'resizing fires dialogresizestart event');
                equals(this, el[0], 'context of event');
                same(ui, {}, 'ui hash in event');
        });
@@ -154,11 +154,11 @@ test("resizeStop", function() {
                resizeStop: function(ev, ui) {
                        ok(true, 'resizing fires resizeStop callback');
                        equals(this, el[0], "context of callback");
-                       equals(ev.type, 'dialogresizeStop', 'event type in callback');
+                       equals(ev.type, 'dialogresizestop', 'event type in callback');
                        same(ui, {}, 'ui hash in callback');
                }
-       }).bind('dialogresizeStop', function(ev, ui) {
-               ok(true, 'resizing fires dialogresizeStop event');
+       }).bind('dialogresizestop', function(ev, ui) {
+               ok(true, 'resizing fires dialogresizestop event');
                equals(this, el[0], 'context of event');
                same(ui, {}, 'ui hash in event');
        });
index 313074032a5eae1dca98e3e56cfeb630c3be95e7..0e8be9abe35cc42afd0b0e9aa7f51206962c33e7 100644 (file)
@@ -346,12 +346,11 @@ $.widget.prototype = {
        },
 
        _trigger: function(type, event, data) {
-               var callback = this.options[type],
-                       eventName = (type == this.widgetEventPrefix
-                               ? type : this.widgetEventPrefix + type);
+               var callback = this.options[type];
 
                event = $.Event(event);
-               event.type = eventName;
+               event.type = (type == this.widgetEventPrefix
+                               ? type : this.widgetEventPrefix + type).toLowerCase();
                data = data || {};
 
                // copy original event properties over to the new event