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;
}
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) {
if ($.fn.resizable) {
uiDialog.resizable({
+ cancel: '.ui-dialog-content',
helper: options.resizeHelper,
maxWidth: options.maxWidth,
maxHeight: options.maxHeight,