]> source.dussan.org Git - jquery-ui.git/commitdiff
Fixed #3059 - cannot select text in dialog content
authorRichard Worth <rdworth@gmail.com>
Thu, 3 Jul 2008 01:37:06 +0000 (01:37 +0000)
committerRichard Worth <rdworth@gmail.com>
Thu, 3 Jul 2008 01:37:06 +0000 (01:37 +0000)
ui/ui.core.js
ui/ui.dialog.js

index 88596c446ab8496af5ecfad93a486818796b3df8..3a7238ca8e17b5a24dc204c26f38ddb9b5de4cec 100644 (file)
@@ -196,7 +196,7 @@ $.ui.mouse = {
                
                var self = this,
                        btnIsLeft = (e.which == 1),
-                       elIsCancel = (typeof this.options.cancel == "string" ? $(e.target).is(this.options.cancel) : false);
+                       elIsCancel = (typeof this.options.cancel == "string" ? $(e.target).parents().add(e.target).filter(this.options.cancel).length : false);
                if (!btnIsLeft || elIsCancel || !this.mouseCapture(e)) {
                        return true;
                }
index d6ebbacb11e1d1a24afb08ca3ed2e935da9b248d..27123b933740ae03089eff10cc2c8055d658ccb4 100644 (file)
@@ -99,9 +99,14 @@ $.widget("ui.dialog", {
                                self.close();
                                return false;
                        });
-               
+
+               this.uiDialogTitlebar.find("*").add(this.uiDialogTitlebar).each(function() {
+                       $.ui.disableSelection(this);
+               });
+
                if ($.fn.draggable) {
                        uiDialog.draggable({
+                               cancel: '.ui-dialog-content',
                                helper: options.dragHelper,
                                handle: '.ui-dialog-titlebar',
                                start: function(e, ui) {
@@ -121,6 +126,7 @@ $.widget("ui.dialog", {
                
                if ($.fn.resizable) {
                        uiDialog.resizable({
+                               cancel: '.ui-dialog-content',
                                helper: options.resizeHelper,
                                maxWidth: options.maxWidth,
                                maxHeight: options.maxHeight,