diff --git a/dist/base.js b/dist/base.js index 458da565f..7e96f0405 100644 --- a/dist/base.js +++ b/dist/base.js @@ -400,7 +400,7 @@ BI.Single = BI.inherit(BI.Widget, { }); this.element.on("mousemove.title" + this.getName(), function (e) { self._e = e; - if (!self.element.__isMouseInBounds__(e)) { + if (!(self.element.find(e.target).length > 0)) { if (BI.isNotNull(self.timeout)) { clearTimeout(self.timeout); } @@ -689,7 +689,7 @@ BI.BasicButton = BI.inherit(BI.Single, { } }); this.element.on("mouseenter." + this.getName(), function (e) { - if (self.element.__isMouseInBounds__(e)) { + if (self.element.find(e.target).length > 0) { if (self.isEnabled() && !self._hover && (o.isShadowShowingOnSelected || !self.isSelected())) { assertMask(); self.$mask.visible(); @@ -697,7 +697,7 @@ BI.BasicButton = BI.inherit(BI.Single, { } }); this.element.on("mousemove." + this.getName(), function (e) { - if (!self.element.__isMouseInBounds__(e)) { + if (!(self.element.find(e.target).length > 0)) { if (self.isEnabled() && !self._hover) { assertMask(); self.$mask.invisible(); @@ -742,7 +742,7 @@ BI.BasicButton = BI.inherit(BI.Single, { // if (e.button === 0) { $(document).bind("mouseup." + self.getName(), function (e) { // if (e.button === 0) { - if (BI.DOM.isExist(self) && !hand.__isMouseInBounds__(e) && mouseDown === true && !selected) { + if (BI.DOM.isExist(self) && !hand.find(e.target).length > 0 && mouseDown === true && !selected) { // self.setSelected(!self.isSelected()); self._trigger(); } @@ -3163,7 +3163,7 @@ BI.Combo = BI.inherit(BI.Widget, { break; case "click": var debounce = BI.debounce(function (e) { - if (self.combo.element.__isMouseInBounds__(e)) { + if (self.element.find(e.target).length > 0) { if (self.isEnabled() && self.isValid() && self.combo.isEnabled() && self.combo.isValid()) { // if (!o.toggle && self.isViewVisible()) { // return; @@ -3189,7 +3189,7 @@ BI.Combo = BI.inherit(BI.Widget, { break; case "click-hover": var debounce = BI.debounce(function (e) { - if (self.combo.element.__isMouseInBounds__(e)) { + if (self.element.find(e.target).length > 0) { if (self.isEnabled() && self.isValid() && self.combo.isEnabled() && self.combo.isValid()) { // if (self.isViewVisible()) { // return; @@ -3606,7 +3606,7 @@ BI.Expander = BI.inherit(BI.Widget, { case "click": if (e) { self.element.off(e + "." + self.getName()).on(e + "." + self.getName(), BI.debounce(function (e) { - if (self.expander.element.__isMouseInBounds__(e)) { + if (self.element.find(e.target).length > 0) { if (self.isEnabled() && self.isValid() && self.expander.isEnabled() && self.expander.isValid()) { o.toggle ? self._toggle() : self._popupView(); if (self.isExpanded()) { @@ -4814,7 +4814,7 @@ BI.Switcher = BI.inherit(BI.Widget, { default : if (e) { self.element.off(e + "." + self.getName()).on(e + "." + self.getName(), BI.debounce(function (e) { - if (self.switcher.element.__isMouseInBounds__(e)) { + if (self.switcher.find(e.target).length > 0) { if (self.isEnabled() && self.switcher.isEnabled()) { o.toggle ? self._toggle() : self._popupView(); if (self.isExpanded()) { @@ -18760,7 +18760,7 @@ BI.TextAreaEditor = BI.inherit(BI.Single, { self.fireEvent(BI.TextAreaEditor.EVENT_FOCUS); } $(document).bind("mousedown." + self.getName(), function (e) { - if (BI.DOM.isExist(self) && !self.element.__isMouseInBounds__(e)) { + if (BI.DOM.isExist(self) && !(self.element.find(e.target).length > 0)) { $(document).unbind("mousedown." + self.getName()); self.content.element.blur(); } diff --git a/dist/bundle.js b/dist/bundle.js index c1c780131..89fb615fd 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -36316,7 +36316,7 @@ BI.Single = BI.inherit(BI.Widget, { }); this.element.on("mousemove.title" + this.getName(), function (e) { self._e = e; - if (!self.element.__isMouseInBounds__(e)) { + if (!(self.element.find(e.target).length > 0)) { if (BI.isNotNull(self.timeout)) { clearTimeout(self.timeout); } @@ -36605,7 +36605,7 @@ BI.BasicButton = BI.inherit(BI.Single, { } }); this.element.on("mouseenter." + this.getName(), function (e) { - if (self.element.__isMouseInBounds__(e)) { + if (self.element.find(e.target).length > 0) { if (self.isEnabled() && !self._hover && (o.isShadowShowingOnSelected || !self.isSelected())) { assertMask(); self.$mask.visible(); @@ -36613,7 +36613,7 @@ BI.BasicButton = BI.inherit(BI.Single, { } }); this.element.on("mousemove." + this.getName(), function (e) { - if (!self.element.__isMouseInBounds__(e)) { + if (!(self.element.find(e.target).length > 0)) { if (self.isEnabled() && !self._hover) { assertMask(); self.$mask.invisible(); @@ -36658,7 +36658,7 @@ BI.BasicButton = BI.inherit(BI.Single, { // if (e.button === 0) { $(document).bind("mouseup." + self.getName(), function (e) { // if (e.button === 0) { - if (BI.DOM.isExist(self) && !hand.__isMouseInBounds__(e) && mouseDown === true && !selected) { + if (BI.DOM.isExist(self) && !hand.find(e.target).length > 0 && mouseDown === true && !selected) { // self.setSelected(!self.isSelected()); self._trigger(); } @@ -39079,7 +39079,7 @@ BI.Combo = BI.inherit(BI.Widget, { break; case "click": var debounce = BI.debounce(function (e) { - if (self.combo.element.__isMouseInBounds__(e)) { + if (self.element.find(e.target).length > 0) { if (self.isEnabled() && self.isValid() && self.combo.isEnabled() && self.combo.isValid()) { // if (!o.toggle && self.isViewVisible()) { // return; @@ -39105,7 +39105,7 @@ BI.Combo = BI.inherit(BI.Widget, { break; case "click-hover": var debounce = BI.debounce(function (e) { - if (self.combo.element.__isMouseInBounds__(e)) { + if (self.element.find(e.target).length > 0) { if (self.isEnabled() && self.isValid() && self.combo.isEnabled() && self.combo.isValid()) { // if (self.isViewVisible()) { // return; @@ -39522,7 +39522,7 @@ BI.Expander = BI.inherit(BI.Widget, { case "click": if (e) { self.element.off(e + "." + self.getName()).on(e + "." + self.getName(), BI.debounce(function (e) { - if (self.expander.element.__isMouseInBounds__(e)) { + if (self.element.find(e.target).length > 0) { if (self.isEnabled() && self.isValid() && self.expander.isEnabled() && self.expander.isValid()) { o.toggle ? self._toggle() : self._popupView(); if (self.isExpanded()) { @@ -40730,7 +40730,7 @@ BI.Switcher = BI.inherit(BI.Widget, { default : if (e) { self.element.off(e + "." + self.getName()).on(e + "." + self.getName(), BI.debounce(function (e) { - if (self.switcher.element.__isMouseInBounds__(e)) { + if (self.switcher.find(e.target).length > 0) { if (self.isEnabled() && self.switcher.isEnabled()) { o.toggle ? self._toggle() : self._popupView(); if (self.isExpanded()) { @@ -54676,7 +54676,7 @@ BI.TextAreaEditor = BI.inherit(BI.Single, { self.fireEvent(BI.TextAreaEditor.EVENT_FOCUS); } $(document).bind("mousedown." + self.getName(), function (e) { - if (BI.DOM.isExist(self) && !self.element.__isMouseInBounds__(e)) { + if (BI.DOM.isExist(self) && !(self.element.find(e.target).length > 0)) { $(document).unbind("mousedown." + self.getName()); self.content.element.blur(); } @@ -98652,7 +98652,7 @@ BI.MultiSelectInsertTrigger = BI.inherit(BI.Trigger, { }); this.element.click(function (e) { - if (self.element.__isMouseInBounds__(e) && !self.numberCounter.element.__isMouseInBounds__(e)) { + if (self.element.find(e.target).length > 0 && !self.numberCounter.element.find(e.target).length > 0) { self.numberCounter.hideView(); } }); @@ -99341,7 +99341,7 @@ BI.MultiSelectTrigger = BI.inherit(BI.Trigger, { }); this.element.click(function (e) { - if (self.element.__isMouseInBounds__(e) && !self.numberCounter.element.__isMouseInBounds__(e)) { + if (self.element.find(e.target).length > 0 && !self.numberCounter.element.find(e.target).length > 0) { self.numberCounter.hideView(); } }); @@ -104884,7 +104884,7 @@ BI.SearchMultiSelectTrigger = BI.inherit(BI.Trigger, { }); this.element.click(function (e) { - if (self.element.__isMouseInBounds__(e) && !self.numberCounter.element.__isMouseInBounds__(e)) { + if (self.element.find(e.target).length > 0 && !self.numberCounter.element.find(e.target).length > 0) { self.numberCounter.hideView(); } }); diff --git a/dist/fineui.js b/dist/fineui.js index 82c9315c1..8fd749472 100644 --- a/dist/fineui.js +++ b/dist/fineui.js @@ -36537,7 +36537,7 @@ BI.Single = BI.inherit(BI.Widget, { }); this.element.on("mousemove.title" + this.getName(), function (e) { self._e = e; - if (!self.element.__isMouseInBounds__(e)) { + if (!(self.element.find(e.target).length > 0)) { if (BI.isNotNull(self.timeout)) { clearTimeout(self.timeout); } @@ -36826,7 +36826,7 @@ BI.BasicButton = BI.inherit(BI.Single, { } }); this.element.on("mouseenter." + this.getName(), function (e) { - if (self.element.__isMouseInBounds__(e)) { + if (self.element.find(e.target).length > 0) { if (self.isEnabled() && !self._hover && (o.isShadowShowingOnSelected || !self.isSelected())) { assertMask(); self.$mask.visible(); @@ -36834,7 +36834,7 @@ BI.BasicButton = BI.inherit(BI.Single, { } }); this.element.on("mousemove." + this.getName(), function (e) { - if (!self.element.__isMouseInBounds__(e)) { + if (!(self.element.find(e.target).length > 0)) { if (self.isEnabled() && !self._hover) { assertMask(); self.$mask.invisible(); @@ -36879,7 +36879,7 @@ BI.BasicButton = BI.inherit(BI.Single, { // if (e.button === 0) { $(document).bind("mouseup." + self.getName(), function (e) { // if (e.button === 0) { - if (BI.DOM.isExist(self) && !hand.__isMouseInBounds__(e) && mouseDown === true && !selected) { + if (BI.DOM.isExist(self) && !hand.find(e.target).length > 0 && mouseDown === true && !selected) { // self.setSelected(!self.isSelected()); self._trigger(); } @@ -39300,7 +39300,7 @@ BI.Combo = BI.inherit(BI.Widget, { break; case "click": var debounce = BI.debounce(function (e) { - if (self.combo.element.__isMouseInBounds__(e)) { + if (self.element.find(e.target).length > 0) { if (self.isEnabled() && self.isValid() && self.combo.isEnabled() && self.combo.isValid()) { // if (!o.toggle && self.isViewVisible()) { // return; @@ -39326,7 +39326,7 @@ BI.Combo = BI.inherit(BI.Widget, { break; case "click-hover": var debounce = BI.debounce(function (e) { - if (self.combo.element.__isMouseInBounds__(e)) { + if (self.element.find(e.target).length > 0) { if (self.isEnabled() && self.isValid() && self.combo.isEnabled() && self.combo.isValid()) { // if (self.isViewVisible()) { // return; @@ -39743,7 +39743,7 @@ BI.Expander = BI.inherit(BI.Widget, { case "click": if (e) { self.element.off(e + "." + self.getName()).on(e + "." + self.getName(), BI.debounce(function (e) { - if (self.expander.element.__isMouseInBounds__(e)) { + if (self.element.find(e.target).length > 0) { if (self.isEnabled() && self.isValid() && self.expander.isEnabled() && self.expander.isValid()) { o.toggle ? self._toggle() : self._popupView(); if (self.isExpanded()) { @@ -40951,7 +40951,7 @@ BI.Switcher = BI.inherit(BI.Widget, { default : if (e) { self.element.off(e + "." + self.getName()).on(e + "." + self.getName(), BI.debounce(function (e) { - if (self.switcher.element.__isMouseInBounds__(e)) { + if (self.switcher.find(e.target).length > 0) { if (self.isEnabled() && self.switcher.isEnabled()) { o.toggle ? self._toggle() : self._popupView(); if (self.isExpanded()) { @@ -54897,7 +54897,7 @@ BI.TextAreaEditor = BI.inherit(BI.Single, { self.fireEvent(BI.TextAreaEditor.EVENT_FOCUS); } $(document).bind("mousedown." + self.getName(), function (e) { - if (BI.DOM.isExist(self) && !self.element.__isMouseInBounds__(e)) { + if (BI.DOM.isExist(self) && !(self.element.find(e.target).length > 0)) { $(document).unbind("mousedown." + self.getName()); self.content.element.blur(); } @@ -98873,7 +98873,7 @@ BI.MultiSelectInsertTrigger = BI.inherit(BI.Trigger, { }); this.element.click(function (e) { - if (self.element.__isMouseInBounds__(e) && !self.numberCounter.element.__isMouseInBounds__(e)) { + if (self.element.find(e.target).length > 0 && !self.numberCounter.element.find(e.target).length > 0) { self.numberCounter.hideView(); } }); @@ -99562,7 +99562,7 @@ BI.MultiSelectTrigger = BI.inherit(BI.Trigger, { }); this.element.click(function (e) { - if (self.element.__isMouseInBounds__(e) && !self.numberCounter.element.__isMouseInBounds__(e)) { + if (self.element.find(e.target).length > 0 && !self.numberCounter.element.find(e.target).length > 0) { self.numberCounter.hideView(); } }); @@ -105105,7 +105105,7 @@ BI.SearchMultiSelectTrigger = BI.inherit(BI.Trigger, { }); this.element.click(function (e) { - if (self.element.__isMouseInBounds__(e) && !self.numberCounter.element.__isMouseInBounds__(e)) { + if (self.element.find(e.target).length > 0 && !self.numberCounter.element.find(e.target).length > 0) { self.numberCounter.hideView(); } }); diff --git a/dist/widget.js b/dist/widget.js index 26b66fbba..2c51bbd38 100644 --- a/dist/widget.js +++ b/dist/widget.js @@ -10472,7 +10472,7 @@ BI.MultiSelectInsertTrigger = BI.inherit(BI.Trigger, { }); this.element.click(function (e) { - if (self.element.__isMouseInBounds__(e) && !self.numberCounter.element.__isMouseInBounds__(e)) { + if (self.element.find(e.target).length > 0 && !self.numberCounter.element.find(e.target).length > 0) { self.numberCounter.hideView(); } }); @@ -11161,7 +11161,7 @@ BI.MultiSelectTrigger = BI.inherit(BI.Trigger, { }); this.element.click(function (e) { - if (self.element.__isMouseInBounds__(e) && !self.numberCounter.element.__isMouseInBounds__(e)) { + if (self.element.find(e.target).length > 0 && !self.numberCounter.element.find(e.target).length > 0) { self.numberCounter.hideView(); } }); @@ -16704,7 +16704,7 @@ BI.SearchMultiSelectTrigger = BI.inherit(BI.Trigger, { }); this.element.click(function (e) { - if (self.element.__isMouseInBounds__(e) && !self.numberCounter.element.__isMouseInBounds__(e)) { + if (self.element.find(e.target).length > 0 && !self.numberCounter.element.find(e.target).length > 0) { self.numberCounter.hideView(); } }); diff --git a/src/base/combination/combo.js b/src/base/combination/combo.js index 700231cd1..b796b6898 100644 --- a/src/base/combination/combo.js +++ b/src/base/combination/combo.js @@ -147,7 +147,7 @@ BI.Combo = BI.inherit(BI.Widget, { break; case "click": var debounce = BI.debounce(function (e) { - if (self.combo.element.__isMouseInBounds__(e)) { + if (self.element.find(e.target).length > 0) { if (self.isEnabled() && self.isValid() && self.combo.isEnabled() && self.combo.isValid()) { // if (!o.toggle && self.isViewVisible()) { // return; @@ -173,7 +173,7 @@ BI.Combo = BI.inherit(BI.Widget, { break; case "click-hover": var debounce = BI.debounce(function (e) { - if (self.combo.element.__isMouseInBounds__(e)) { + if (self.element.find(e.target).length > 0) { if (self.isEnabled() && self.isValid() && self.combo.isEnabled() && self.combo.isValid()) { // if (self.isViewVisible()) { // return; diff --git a/src/base/combination/expander.js b/src/base/combination/expander.js index 58c3ed70b..e12e3ac94 100644 --- a/src/base/combination/expander.js +++ b/src/base/combination/expander.js @@ -106,7 +106,7 @@ BI.Expander = BI.inherit(BI.Widget, { case "click": if (e) { self.element.off(e + "." + self.getName()).on(e + "." + self.getName(), BI.debounce(function (e) { - if (self.expander.element.__isMouseInBounds__(e)) { + if (self.element.find(e.target).length > 0) { if (self.isEnabled() && self.isValid() && self.expander.isEnabled() && self.expander.isValid()) { o.toggle ? self._toggle() : self._popupView(); if (self.isExpanded()) { diff --git a/src/base/combination/switcher.js b/src/base/combination/switcher.js index d6c1f1300..6926aa028 100644 --- a/src/base/combination/switcher.js +++ b/src/base/combination/switcher.js @@ -103,7 +103,7 @@ BI.Switcher = BI.inherit(BI.Widget, { default : if (e) { self.element.off(e + "." + self.getName()).on(e + "." + self.getName(), BI.debounce(function (e) { - if (self.switcher.element.__isMouseInBounds__(e)) { + if (self.switcher.find(e.target).length > 0) { if (self.isEnabled() && self.switcher.isEnabled()) { o.toggle ? self._toggle() : self._popupView(); if (self.isExpanded()) { diff --git a/src/base/single/button/button.basic.js b/src/base/single/button/button.basic.js index e0a4bf156..c29a7e622 100644 --- a/src/base/single/button/button.basic.js +++ b/src/base/single/button/button.basic.js @@ -76,7 +76,7 @@ BI.BasicButton = BI.inherit(BI.Single, { } }); this.element.on("mouseenter." + this.getName(), function (e) { - if (self.element.__isMouseInBounds__(e)) { + if (self.element.find(e.target).length > 0) { if (self.isEnabled() && !self._hover && (o.isShadowShowingOnSelected || !self.isSelected())) { assertMask(); self.$mask.visible(); @@ -84,7 +84,7 @@ BI.BasicButton = BI.inherit(BI.Single, { } }); this.element.on("mousemove." + this.getName(), function (e) { - if (!self.element.__isMouseInBounds__(e)) { + if (!(self.element.find(e.target).length > 0)) { if (self.isEnabled() && !self._hover) { assertMask(); self.$mask.invisible(); @@ -129,7 +129,7 @@ BI.BasicButton = BI.inherit(BI.Single, { // if (e.button === 0) { $(document).bind("mouseup." + self.getName(), function (e) { // if (e.button === 0) { - if (BI.DOM.isExist(self) && !hand.__isMouseInBounds__(e) && mouseDown === true && !selected) { + if (BI.DOM.isExist(self) && !hand.find(e.target).length > 0 && mouseDown === true && !selected) { // self.setSelected(!self.isSelected()); self._trigger(); } diff --git a/src/base/single/editor/editor.textarea.js b/src/base/single/editor/editor.textarea.js index 5e6335c5d..7a81b79e6 100644 --- a/src/base/single/editor/editor.textarea.js +++ b/src/base/single/editor/editor.textarea.js @@ -48,7 +48,7 @@ BI.TextAreaEditor = BI.inherit(BI.Single, { self.fireEvent(BI.TextAreaEditor.EVENT_FOCUS); } $(document).bind("mousedown." + self.getName(), function (e) { - if (BI.DOM.isExist(self) && !self.element.__isMouseInBounds__(e)) { + if (BI.DOM.isExist(self) && !(self.element.find(e.target).length > 0)) { $(document).unbind("mousedown." + self.getName()); self.content.element.blur(); } diff --git a/src/base/single/single.js b/src/base/single/single.js index 56875e0c2..17759d7c5 100644 --- a/src/base/single/single.js +++ b/src/base/single/single.js @@ -77,7 +77,7 @@ BI.Single = BI.inherit(BI.Widget, { }); this.element.on("mousemove.title" + this.getName(), function (e) { self._e = e; - if (!self.element.__isMouseInBounds__(e)) { + if (!(self.element.find(e.target).length > 0)) { if (BI.isNotNull(self.timeout)) { clearTimeout(self.timeout); } diff --git a/src/core/func/dom.js b/src/core/func/dom.js index 08ad22d6e..2b8e2e7a0 100644 --- a/src/core/func/dom.js +++ b/src/core/func/dom.js @@ -119,11 +119,9 @@ BI.extend(jQuery.fn, { }, __isMouseInBounds__: function (e) { - var offset2Body = this.get(0).getBoundingClientRect ? this.get(0).getBoundingClientRect() : this.offset(); - var width = offset2Body.width || this.outerWidth(); - var height = offset2Body.height || this.outerHeight(); - return !(e.pageX < offset2Body.left || e.pageX > offset2Body.left + width - || e.pageY < offset2Body.top || e.pageY > offset2Body.top + height); + var offset2Body = this.offset(); + return !(e.pageX < offset2Body.left || e.pageX > offset2Body.left + this.outerWidth() + || e.pageY < offset2Body.top || e.pageY > offset2Body.top + this.outerHeight()); }, __hasZIndexMask__: function (zindex) { diff --git a/src/widget/multiselect/multiselect.insert.trigger.js b/src/widget/multiselect/multiselect.insert.trigger.js index 8fb557ab5..c9c1290d7 100644 --- a/src/widget/multiselect/multiselect.insert.trigger.js +++ b/src/widget/multiselect/multiselect.insert.trigger.js @@ -110,7 +110,7 @@ BI.MultiSelectInsertTrigger = BI.inherit(BI.Trigger, { }); this.element.click(function (e) { - if (self.element.__isMouseInBounds__(e) && !self.numberCounter.element.__isMouseInBounds__(e)) { + if (self.element.find(e.target).length > 0 && !self.numberCounter.element.find(e.target).length > 0) { self.numberCounter.hideView(); } }); diff --git a/src/widget/multiselect/multiselect.trigger.js b/src/widget/multiselect/multiselect.trigger.js index b7d62cf4c..74241fc25 100644 --- a/src/widget/multiselect/multiselect.trigger.js +++ b/src/widget/multiselect/multiselect.trigger.js @@ -107,7 +107,7 @@ BI.MultiSelectTrigger = BI.inherit(BI.Trigger, { }); this.element.click(function (e) { - if (self.element.__isMouseInBounds__(e) && !self.numberCounter.element.__isMouseInBounds__(e)) { + if (self.element.find(e.target).length > 0 && !self.numberCounter.element.find(e.target).length > 0) { self.numberCounter.hideView(); } }); diff --git a/src/widget/searchmultitextvaluecombo/multitextvalue.combo.trigger.search.js b/src/widget/searchmultitextvaluecombo/multitextvalue.combo.trigger.search.js index 66a11f7d1..9c6168d2e 100644 --- a/src/widget/searchmultitextvaluecombo/multitextvalue.combo.trigger.search.js +++ b/src/widget/searchmultitextvaluecombo/multitextvalue.combo.trigger.search.js @@ -101,7 +101,7 @@ BI.SearchMultiSelectTrigger = BI.inherit(BI.Trigger, { }); this.element.click(function (e) { - if (self.element.__isMouseInBounds__(e) && !self.numberCounter.element.__isMouseInBounds__(e)) { + if (self.element.find(e.target).length > 0 && !self.numberCounter.element.find(e.target).length > 0) { self.numberCounter.hideView(); } });