From 761528d64e2e6f5ad393a664f06f0269db5bbbc7 Mon Sep 17 00:00:00 2001 From: yiminghe Date: Wed, 20 Aug 2014 14:25:26 +0800 Subject: [PATCH] fix ie11 pointer event. Fixes #574 --- build/component/control-min.js | 4 +- build/component/control.js | 5 +- .../control/coverage/src/control.js | 592 +++++++++--------- .../sub-modules/control/src/control.js | 4 +- 4 files changed, 311 insertions(+), 294 deletions(-) diff --git a/build/component/control-min.js b/build/component/control-min.js index aead43e740..0d20eedd6c 100644 --- a/build/component/control-min.js +++ b/build/component/control-min.js @@ -1,7 +1,7 @@ /* Copyright 2014, KISSY v1.47 MIT Licensed -build time: Aug 18 12:19 +build time: Aug 20 14:23 */ KISSY.add("component/control/process",["base","promise"],function(f,c){function h(d){d.fire("beforeSyncUI");d.syncUI();d.__callPluginsMethod("pluginSyncUI");d.fire("afterSyncUI")}var k=c("base"),m=c("promise").Defer,g=k.prototype.__getHook,e=f.noop,i=k.extend({bindInternal:e,syncInternal:e,initializer:function(){this._renderedDefer=new m},renderUI:e,syncUI:e,bindUI:e,onRendered:function(d){return this._renderedDefer.promise.then(d)},create:function(){this.get("created")||(this.fire("beforeCreateDom"), this.createInternal(),this.__callPluginsMethod("pluginCreateDom"),this.fire("afterCreateDom"),this.setInternal("created",!0));return this},createInternal:function(){this.createDom()},render:function(){this.get("rendered")||(this.create(),this.fire("beforeRenderUI"),this.renderUI(),this.__callPluginsMethod("pluginRenderUI"),this.fire("afterRenderUI"),this.fire("beforeBindUI"),i.superclass.bindInternal.call(this),this.bindUI(),this.__callPluginsMethod("pluginBindUI"),this.fire("afterBindUI"),i.superclass.syncInternal.call(this), @@ -25,7 +25,7 @@ this.view=b=new a({control:this}));b.create();a=b.getKeyEventTarget();this.get(" this.handleContextMenu,this);a.on(d.start,this.handleMouseDown,this).on(d.end,this.handleMouseUp,this).on(d.tap,this.handleClick,this);if(d.cancel)a.on(d.cancel,this.handleMouseUp,this);if(9>i)a.on("dblclick",this.handleDblClick,this)}},sync:function(){this.fire("beforeSyncUI");this.syncUI();this.view.sync();this.__callPluginsMethod("pluginSyncUI");this.fire("afterSyncUI")},createComponent:function(a,b){return g.createComponent(a,b||this)},_onSetFocused:function(a){var b=this.view.getKeyEventTarget()[0]; a?b.focus():b.ownerDocument.activeElement===b&&b.ownerDocument.body.focus()},_onSetX:function(a){this.$el.offset({left:a})},_onSetY:function(a){this.$el.offset({top:a})},_onSetVisible:function(a){this.fire(a?"show":"hide")},show:function(){this.render();this.set("visible",!0);return this},hide:function(){this.set("visible",!1);return this},focus:function(){this.get("focusable")&&this.set("focused",!0)},blur:function(){this.get("focusable")&&this.set("focused",!1)},move:function(a,b){this.set({x:a, y:b})},handleDblClick:function(a){this.get("disabled")||this.handleDblClickInternal(a)},handleDblClickInternal:function(a){this.handleClickInternal(a)},handleMouseEnter:function(a){this.get("disabled")||this.handleMouseEnterInternal(a)},handleMouseEnterInternal:function(a){this.set("highlighted",!!a)},handleMouseLeave:function(a){this.get("disabled")||this.handleMouseLeaveInternal(a)},handleMouseLeaveInternal:function(a){this.set("active",!1);this.set("highlighted",!a)},handleMouseDown:function(a){this.get("disabled")|| -this.handleMouseDownInternal(a)},handleMouseDownInternal:function(a){var b;if(1===a.which||n)this.get("activeable")&&this.set("active",!0),this.get("focusable")&&this.focus(),!this.get("allowTextSelection")&&-1!==a.originalEvent.type.toLowerCase().indexOf("mouse")&&(b=(b=a.target.nodeName)&&b.toLowerCase(),"input"!==b&&"textarea"!==b&&"button"!==b&&a.preventDefault())},handleMouseUp:function(a){this.get("disabled")||this.handleMouseUpInternal(a)},handleMouseUpInternal:function(a){this.get("active")&& +this.handleMouseDownInternal(a)},handleMouseDownInternal:function(a){var b;if(1===a.which||n)if(this.get("activeable")&&this.set("active",!0),this.get("focusable")&&this.focus(),b=a.originalEvent.type.toLowerCase(),!this.get("allowTextSelection")&&(-1!==b.indexOf("mouse")||-1!==b.indexOf("pointer")))b=(b=a.target.nodeName)&&b.toLowerCase(),"input"!==b&&"textarea"!==b&&"button"!==b&&a.preventDefault()},handleMouseUp:function(a){this.get("disabled")||this.handleMouseUpInternal(a)},handleMouseUpInternal:function(a){this.get("active")&& (1===a.which||n)&&this.set("active",!1)},handleContextMenu:function(a){this.get("disabled")||this.handleContextMenuInternal(a)},handleContextMenuInternal:function(){},handleFocus:function(){this.get("disabled")||this.handleFocusInternal()},handleFocusInternal:function(){this.focus();this.fire("focus")},handleBlur:function(){this.get("disabled")||this.handleBlurInternal()},handleBlurInternal:function(){this.blur();this.fire("blur")},handleKeydown:function(a){if(!this.get("disabled")&&this.handleKeyDownInternal(a))return a.halt(), !0},handleKeyDownInternal:function(a){if(a.keyCode===k.KeyCode.ENTER)return this.handleClickInternal(a)},handleClick:function(a){this.get("disabled")||this.handleClickInternal(a)},handleClickInternal:function(){this.get("focusable")&&this.focus()},destructor:function(){g.removeComponent(this.get("id"));this.view?this.view.destroy():this.get("srcNode")&&this.get("srcNode").remove()}},{name:"control",ATTRS:{id:{view:1,valueFn:function(){return f.guid("ks-component")}},content:{view:1,value:""},width:{view:1}, height:{view:1},elCls:{view:1,value:[],setter:function(a){"string"===typeof a&&(a=a.split(/\s+/));return a||[]}},elStyle:{view:1,value:{}},elAttrs:{view:1,value:{}},elBefore:{},el:{setter:function(a){this.$el=a;this.el=a[0]}},x:{},y:{},xy:{setter:function(a){var b=f.makeArray(a);b.length&&(void 0!==b[0]&&this.set("x",b[0]),void 0!==b[1]&&this.set("y",b[1]));return a},getter:function(){return[this.get("x"),this.get("y")]}},zIndex:{view:1},render:{},visible:{sync:0,value:!0,view:1},srcNode:{setter:function(a){return k.all(a)}}, diff --git a/build/component/control.js b/build/component/control.js index eab67f0714..70d83e3213 100644 --- a/build/component/control.js +++ b/build/component/control.js @@ -1,7 +1,7 @@ /* Copyright 2014, KISSY v1.47 MIT Licensed -build time: Aug 18 12:19 +build time: Aug 20 14:23 */ /* Combined processedModules by KISSY Module Compiler: @@ -558,7 +558,8 @@ KISSY.add("component/control", ["node", "./control/process", "component/manager" if(self.get("focusable")) { self.focus() } - if(!self.get("allowTextSelection") && ev.originalEvent.type.toLowerCase().indexOf("mouse") !== -1) { + var type = ev.originalEvent.type.toLowerCase(); + if(!self.get("allowTextSelection") && (type.indexOf("mouse") !== -1 || type.indexOf("pointer") !== -1)) { n = ev.target.nodeName; n = n && n.toLowerCase(); if(n !== "input" && n !== "textarea" && n !== "button") { diff --git a/src/component/sub-modules/control/coverage/src/control.js b/src/component/sub-modules/control/coverage/src/control.js index ca8c8c581b..639c691c4f 100644 --- a/src/component/sub-modules/control/coverage/src/control.js +++ b/src/component/sub-modules/control/coverage/src/control.js @@ -304,82 +304,83 @@ if (! _$jscoverage['/control.js']) { _$jscoverage['/control.js'].lineData[262] = 0; _$jscoverage['/control.js'].lineData[263] = 0; _$jscoverage['/control.js'].lineData[265] = 0; - _$jscoverage['/control.js'].lineData[268] = 0; - _$jscoverage['/control.js'].lineData[269] = 0; + _$jscoverage['/control.js'].lineData[266] = 0; + _$jscoverage['/control.js'].lineData[270] = 0; _$jscoverage['/control.js'].lineData[271] = 0; - _$jscoverage['/control.js'].lineData[272] = 0; - _$jscoverage['/control.js'].lineData[279] = 0; - _$jscoverage['/control.js'].lineData[280] = 0; - _$jscoverage['/control.js'].lineData[292] = 0; + _$jscoverage['/control.js'].lineData[273] = 0; + _$jscoverage['/control.js'].lineData[274] = 0; + _$jscoverage['/control.js'].lineData[281] = 0; + _$jscoverage['/control.js'].lineData[282] = 0; _$jscoverage['/control.js'].lineData[294] = 0; - _$jscoverage['/control.js'].lineData[295] = 0; - _$jscoverage['/control.js'].lineData[300] = 0; - _$jscoverage['/control.js'].lineData[301] = 0; - _$jscoverage['/control.js'].lineData[313] = 0; - _$jscoverage['/control.js'].lineData[314] = 0; - _$jscoverage['/control.js'].lineData[323] = 0; - _$jscoverage['/control.js'].lineData[324] = 0; - _$jscoverage['/control.js'].lineData[328] = 0; - _$jscoverage['/control.js'].lineData[329] = 0; - _$jscoverage['/control.js'].lineData[338] = 0; - _$jscoverage['/control.js'].lineData[339] = 0; - _$jscoverage['/control.js'].lineData[343] = 0; - _$jscoverage['/control.js'].lineData[344] = 0; + _$jscoverage['/control.js'].lineData[296] = 0; + _$jscoverage['/control.js'].lineData[297] = 0; + _$jscoverage['/control.js'].lineData[302] = 0; + _$jscoverage['/control.js'].lineData[303] = 0; + _$jscoverage['/control.js'].lineData[315] = 0; + _$jscoverage['/control.js'].lineData[316] = 0; + _$jscoverage['/control.js'].lineData[325] = 0; + _$jscoverage['/control.js'].lineData[326] = 0; + _$jscoverage['/control.js'].lineData[330] = 0; + _$jscoverage['/control.js'].lineData[331] = 0; + _$jscoverage['/control.js'].lineData[340] = 0; + _$jscoverage['/control.js'].lineData[341] = 0; _$jscoverage['/control.js'].lineData[345] = 0; _$jscoverage['/control.js'].lineData[346] = 0; + _$jscoverage['/control.js'].lineData[347] = 0; _$jscoverage['/control.js'].lineData[348] = 0; - _$jscoverage['/control.js'].lineData[357] = 0; - _$jscoverage['/control.js'].lineData[358] = 0; + _$jscoverage['/control.js'].lineData[350] = 0; + _$jscoverage['/control.js'].lineData[359] = 0; _$jscoverage['/control.js'].lineData[360] = 0; - _$jscoverage['/control.js'].lineData[364] = 0; - _$jscoverage['/control.js'].lineData[365] = 0; - _$jscoverage['/control.js'].lineData[375] = 0; - _$jscoverage['/control.js'].lineData[376] = 0; + _$jscoverage['/control.js'].lineData[362] = 0; + _$jscoverage['/control.js'].lineData[366] = 0; + _$jscoverage['/control.js'].lineData[367] = 0; _$jscoverage['/control.js'].lineData[377] = 0; - _$jscoverage['/control.js'].lineData[385] = 0; + _$jscoverage['/control.js'].lineData[378] = 0; + _$jscoverage['/control.js'].lineData[379] = 0; _$jscoverage['/control.js'].lineData[387] = 0; - _$jscoverage['/control.js'].lineData[388] = 0; _$jscoverage['/control.js'].lineData[389] = 0; _$jscoverage['/control.js'].lineData[390] = 0; _$jscoverage['/control.js'].lineData[391] = 0; - _$jscoverage['/control.js'].lineData[402] = 0; - _$jscoverage['/control.js'].lineData[466] = 0; - _$jscoverage['/control.js'].lineData[467] = 0; + _$jscoverage['/control.js'].lineData[392] = 0; + _$jscoverage['/control.js'].lineData[393] = 0; + _$jscoverage['/control.js'].lineData[404] = 0; + _$jscoverage['/control.js'].lineData[468] = 0; _$jscoverage['/control.js'].lineData[469] = 0; - _$jscoverage['/control.js'].lineData[519] = 0; - _$jscoverage['/control.js'].lineData[520] = 0; - _$jscoverage['/control.js'].lineData[565] = 0; + _$jscoverage['/control.js'].lineData[471] = 0; + _$jscoverage['/control.js'].lineData[521] = 0; + _$jscoverage['/control.js'].lineData[522] = 0; _$jscoverage['/control.js'].lineData[567] = 0; - _$jscoverage['/control.js'].lineData[568] = 0; _$jscoverage['/control.js'].lineData[569] = 0; + _$jscoverage['/control.js'].lineData[570] = 0; _$jscoverage['/control.js'].lineData[571] = 0; - _$jscoverage['/control.js'].lineData[572] = 0; - _$jscoverage['/control.js'].lineData[575] = 0; - _$jscoverage['/control.js'].lineData[578] = 0; - _$jscoverage['/control.js'].lineData[645] = 0; - _$jscoverage['/control.js'].lineData[794] = 0; - _$jscoverage['/control.js'].lineData[795] = 0; + _$jscoverage['/control.js'].lineData[573] = 0; + _$jscoverage['/control.js'].lineData[574] = 0; + _$jscoverage['/control.js'].lineData[577] = 0; + _$jscoverage['/control.js'].lineData[580] = 0; + _$jscoverage['/control.js'].lineData[647] = 0; + _$jscoverage['/control.js'].lineData[796] = 0; _$jscoverage['/control.js'].lineData[797] = 0; - _$jscoverage['/control.js'].lineData[798] = 0; - _$jscoverage['/control.js'].lineData[834] = 0; - _$jscoverage['/control.js'].lineData[840] = 0; - _$jscoverage['/control.js'].lineData[841] = 0; + _$jscoverage['/control.js'].lineData[799] = 0; + _$jscoverage['/control.js'].lineData[800] = 0; + _$jscoverage['/control.js'].lineData[836] = 0; + _$jscoverage['/control.js'].lineData[842] = 0; _$jscoverage['/control.js'].lineData[843] = 0; - _$jscoverage['/control.js'].lineData[844] = 0; _$jscoverage['/control.js'].lineData[845] = 0; + _$jscoverage['/control.js'].lineData[846] = 0; _$jscoverage['/control.js'].lineData[847] = 0; - _$jscoverage['/control.js'].lineData[850] = 0; - _$jscoverage['/control.js'].lineData[871] = 0; + _$jscoverage['/control.js'].lineData[849] = 0; + _$jscoverage['/control.js'].lineData[852] = 0; _$jscoverage['/control.js'].lineData[873] = 0; - _$jscoverage['/control.js'].lineData[880] = 0; - _$jscoverage['/control.js'].lineData[881] = 0; - _$jscoverage['/control.js'].lineData[884] = 0; + _$jscoverage['/control.js'].lineData[875] = 0; + _$jscoverage['/control.js'].lineData[882] = 0; + _$jscoverage['/control.js'].lineData[883] = 0; _$jscoverage['/control.js'].lineData[886] = 0; - _$jscoverage['/control.js'].lineData[887] = 0; - _$jscoverage['/control.js'].lineData[890] = 0; - _$jscoverage['/control.js'].lineData[891] = 0; + _$jscoverage['/control.js'].lineData[888] = 0; + _$jscoverage['/control.js'].lineData[889] = 0; + _$jscoverage['/control.js'].lineData[892] = 0; _$jscoverage['/control.js'].lineData[893] = 0; - _$jscoverage['/control.js'].lineData[896] = 0; + _$jscoverage['/control.js'].lineData[895] = 0; + _$jscoverage['/control.js'].lineData[898] = 0; } if (! _$jscoverage['/control.js'].functionData) { _$jscoverage['/control.js'].functionData = []; @@ -470,179 +471,190 @@ if (! _$jscoverage['/control.js'].branchData) { _$jscoverage['/control.js'].branchData['259'][1] = new BranchData(); _$jscoverage['/control.js'].branchData['262'] = []; _$jscoverage['/control.js'].branchData['262'][1] = new BranchData(); - _$jscoverage['/control.js'].branchData['265'] = []; - _$jscoverage['/control.js'].branchData['265'][1] = new BranchData(); - _$jscoverage['/control.js'].branchData['265'][2] = new BranchData(); - _$jscoverage['/control.js'].branchData['269'] = []; - _$jscoverage['/control.js'].branchData['269'][1] = new BranchData(); + _$jscoverage['/control.js'].branchData['266'] = []; + _$jscoverage['/control.js'].branchData['266'][1] = new BranchData(); + _$jscoverage['/control.js'].branchData['267'] = []; + _$jscoverage['/control.js'].branchData['267'][1] = new BranchData(); + _$jscoverage['/control.js'].branchData['267'][2] = new BranchData(); + _$jscoverage['/control.js'].branchData['267'][3] = new BranchData(); _$jscoverage['/control.js'].branchData['271'] = []; _$jscoverage['/control.js'].branchData['271'][1] = new BranchData(); - _$jscoverage['/control.js'].branchData['271'][2] = new BranchData(); - _$jscoverage['/control.js'].branchData['271'][3] = new BranchData(); - _$jscoverage['/control.js'].branchData['271'][4] = new BranchData(); - _$jscoverage['/control.js'].branchData['271'][5] = new BranchData(); - _$jscoverage['/control.js'].branchData['279'] = []; - _$jscoverage['/control.js'].branchData['279'][1] = new BranchData(); - _$jscoverage['/control.js'].branchData['294'] = []; - _$jscoverage['/control.js'].branchData['294'][1] = new BranchData(); - _$jscoverage['/control.js'].branchData['294'][2] = new BranchData(); - _$jscoverage['/control.js'].branchData['294'][3] = new BranchData(); - _$jscoverage['/control.js'].branchData['300'] = []; - _$jscoverage['/control.js'].branchData['300'][1] = new BranchData(); - _$jscoverage['/control.js'].branchData['313'] = []; - _$jscoverage['/control.js'].branchData['313'][1] = new BranchData(); - _$jscoverage['/control.js'].branchData['328'] = []; - _$jscoverage['/control.js'].branchData['328'][1] = new BranchData(); - _$jscoverage['/control.js'].branchData['344'] = []; - _$jscoverage['/control.js'].branchData['344'][1] = new BranchData(); - _$jscoverage['/control.js'].branchData['357'] = []; - _$jscoverage['/control.js'].branchData['357'][1] = new BranchData(); - _$jscoverage['/control.js'].branchData['364'] = []; - _$jscoverage['/control.js'].branchData['364'][1] = new BranchData(); - _$jscoverage['/control.js'].branchData['376'] = []; - _$jscoverage['/control.js'].branchData['376'][1] = new BranchData(); - _$jscoverage['/control.js'].branchData['388'] = []; - _$jscoverage['/control.js'].branchData['388'][1] = new BranchData(); + _$jscoverage['/control.js'].branchData['273'] = []; + _$jscoverage['/control.js'].branchData['273'][1] = new BranchData(); + _$jscoverage['/control.js'].branchData['273'][2] = new BranchData(); + _$jscoverage['/control.js'].branchData['273'][3] = new BranchData(); + _$jscoverage['/control.js'].branchData['273'][4] = new BranchData(); + _$jscoverage['/control.js'].branchData['273'][5] = new BranchData(); + _$jscoverage['/control.js'].branchData['281'] = []; + _$jscoverage['/control.js'].branchData['281'][1] = new BranchData(); + _$jscoverage['/control.js'].branchData['296'] = []; + _$jscoverage['/control.js'].branchData['296'][1] = new BranchData(); + _$jscoverage['/control.js'].branchData['296'][2] = new BranchData(); + _$jscoverage['/control.js'].branchData['296'][3] = new BranchData(); + _$jscoverage['/control.js'].branchData['302'] = []; + _$jscoverage['/control.js'].branchData['302'][1] = new BranchData(); + _$jscoverage['/control.js'].branchData['315'] = []; + _$jscoverage['/control.js'].branchData['315'][1] = new BranchData(); + _$jscoverage['/control.js'].branchData['330'] = []; + _$jscoverage['/control.js'].branchData['330'][1] = new BranchData(); + _$jscoverage['/control.js'].branchData['346'] = []; + _$jscoverage['/control.js'].branchData['346'][1] = new BranchData(); + _$jscoverage['/control.js'].branchData['359'] = []; + _$jscoverage['/control.js'].branchData['359'][1] = new BranchData(); + _$jscoverage['/control.js'].branchData['366'] = []; + _$jscoverage['/control.js'].branchData['366'][1] = new BranchData(); + _$jscoverage['/control.js'].branchData['378'] = []; + _$jscoverage['/control.js'].branchData['378'][1] = new BranchData(); _$jscoverage['/control.js'].branchData['390'] = []; _$jscoverage['/control.js'].branchData['390'][1] = new BranchData(); - _$jscoverage['/control.js'].branchData['466'] = []; - _$jscoverage['/control.js'].branchData['466'][1] = new BranchData(); - _$jscoverage['/control.js'].branchData['469'] = []; - _$jscoverage['/control.js'].branchData['469'][1] = new BranchData(); - _$jscoverage['/control.js'].branchData['567'] = []; - _$jscoverage['/control.js'].branchData['567'][1] = new BranchData(); - _$jscoverage['/control.js'].branchData['568'] = []; - _$jscoverage['/control.js'].branchData['568'][1] = new BranchData(); - _$jscoverage['/control.js'].branchData['571'] = []; - _$jscoverage['/control.js'].branchData['571'][1] = new BranchData(); - _$jscoverage['/control.js'].branchData['766'] = []; - _$jscoverage['/control.js'].branchData['766'][1] = new BranchData(); - _$jscoverage['/control.js'].branchData['797'] = []; - _$jscoverage['/control.js'].branchData['797'][1] = new BranchData(); - _$jscoverage['/control.js'].branchData['846'] = []; - _$jscoverage['/control.js'].branchData['846'][1] = new BranchData(); - _$jscoverage['/control.js'].branchData['886'] = []; - _$jscoverage['/control.js'].branchData['886'][1] = new BranchData(); + _$jscoverage['/control.js'].branchData['392'] = []; + _$jscoverage['/control.js'].branchData['392'][1] = new BranchData(); + _$jscoverage['/control.js'].branchData['468'] = []; + _$jscoverage['/control.js'].branchData['468'][1] = new BranchData(); + _$jscoverage['/control.js'].branchData['471'] = []; + _$jscoverage['/control.js'].branchData['471'][1] = new BranchData(); + _$jscoverage['/control.js'].branchData['569'] = []; + _$jscoverage['/control.js'].branchData['569'][1] = new BranchData(); + _$jscoverage['/control.js'].branchData['570'] = []; + _$jscoverage['/control.js'].branchData['570'][1] = new BranchData(); + _$jscoverage['/control.js'].branchData['573'] = []; + _$jscoverage['/control.js'].branchData['573'][1] = new BranchData(); + _$jscoverage['/control.js'].branchData['768'] = []; + _$jscoverage['/control.js'].branchData['768'][1] = new BranchData(); + _$jscoverage['/control.js'].branchData['799'] = []; + _$jscoverage['/control.js'].branchData['799'][1] = new BranchData(); + _$jscoverage['/control.js'].branchData['848'] = []; + _$jscoverage['/control.js'].branchData['848'][1] = new BranchData(); + _$jscoverage['/control.js'].branchData['888'] = []; + _$jscoverage['/control.js'].branchData['888'][1] = new BranchData(); } -_$jscoverage['/control.js'].branchData['886'][1].init(384, 6, 'xclass'); -function visit104_886_1(result) { - _$jscoverage['/control.js'].branchData['886'][1].ranCondition(result); +_$jscoverage['/control.js'].branchData['888'][1].init(384, 6, 'xclass'); +function visit106_888_1(result) { + _$jscoverage['/control.js'].branchData['888'][1].ranCondition(result); return result; -}_$jscoverage['/control.js'].branchData['846'][1].init(110, 24, '!attrs || !attrs.xrender'); -function visit103_846_1(result) { - _$jscoverage['/control.js'].branchData['846'][1].ranCondition(result); +}_$jscoverage['/control.js'].branchData['848'][1].init(110, 24, '!attrs || !attrs.xrender'); +function visit105_848_1(result) { + _$jscoverage['/control.js'].branchData['848'][1].ranCondition(result); return result; -}_$jscoverage['/control.js'].branchData['797'][1].init(167, 1, 'p'); -function visit102_797_1(result) { - _$jscoverage['/control.js'].branchData['797'][1].ranCondition(result); +}_$jscoverage['/control.js'].branchData['799'][1].init(167, 1, 'p'); +function visit104_799_1(result) { + _$jscoverage['/control.js'].branchData['799'][1].ranCondition(result); return result; -}_$jscoverage['/control.js'].branchData['766'][1].init(57, 40, 'S.config(\'component/prefixCls\') || \'ks-\''); -function visit101_766_1(result) { - _$jscoverage['/control.js'].branchData['766'][1].ranCondition(result); +}_$jscoverage['/control.js'].branchData['768'][1].init(57, 40, 'S.config(\'component/prefixCls\') || \'ks-\''); +function visit103_768_1(result) { + _$jscoverage['/control.js'].branchData['768'][1].ranCondition(result); return result; -}_$jscoverage['/control.js'].branchData['571'][1].init(172, 19, 'xy[1] !== undefined'); -function visit100_571_1(result) { - _$jscoverage['/control.js'].branchData['571'][1].ranCondition(result); +}_$jscoverage['/control.js'].branchData['573'][1].init(172, 19, 'xy[1] !== undefined'); +function visit102_573_1(result) { + _$jscoverage['/control.js'].branchData['573'][1].ranCondition(result); return result; -}_$jscoverage['/control.js'].branchData['568'][1].init(33, 19, 'xy[0] !== undefined'); -function visit99_568_1(result) { - _$jscoverage['/control.js'].branchData['568'][1].ranCondition(result); +}_$jscoverage['/control.js'].branchData['570'][1].init(33, 19, 'xy[0] !== undefined'); +function visit101_570_1(result) { + _$jscoverage['/control.js'].branchData['570'][1].ranCondition(result); return result; -}_$jscoverage['/control.js'].branchData['567'][1].init(119, 9, 'xy.length'); -function visit98_567_1(result) { - _$jscoverage['/control.js'].branchData['567'][1].ranCondition(result); +}_$jscoverage['/control.js'].branchData['569'][1].init(119, 9, 'xy.length'); +function visit100_569_1(result) { + _$jscoverage['/control.js'].branchData['569'][1].ranCondition(result); return result; -}_$jscoverage['/control.js'].branchData['469'][1].init(159, 7, 'v || []'); -function visit97_469_1(result) { - _$jscoverage['/control.js'].branchData['469'][1].ranCondition(result); +}_$jscoverage['/control.js'].branchData['471'][1].init(159, 7, 'v || []'); +function visit99_471_1(result) { + _$jscoverage['/control.js'].branchData['471'][1].ranCondition(result); return result; -}_$jscoverage['/control.js'].branchData['466'][1].init(29, 21, 'typeof v === \'string\''); -function visit96_466_1(result) { - _$jscoverage['/control.js'].branchData['466'][1].ranCondition(result); +}_$jscoverage['/control.js'].branchData['468'][1].init(29, 21, 'typeof v === \'string\''); +function visit98_468_1(result) { + _$jscoverage['/control.js'].branchData['468'][1].ranCondition(result); return result; -}_$jscoverage['/control.js'].branchData['390'][1].init(241, 19, 'self.get(\'srcNode\')'); -function visit95_390_1(result) { +}_$jscoverage['/control.js'].branchData['392'][1].init(241, 19, 'self.get(\'srcNode\')'); +function visit97_392_1(result) { + _$jscoverage['/control.js'].branchData['392'][1].ranCondition(result); + return result; +}_$jscoverage['/control.js'].branchData['390'][1].init(159, 9, 'self.view'); +function visit96_390_1(result) { _$jscoverage['/control.js'].branchData['390'][1].ranCondition(result); return result; -}_$jscoverage['/control.js'].branchData['388'][1].init(159, 9, 'self.view'); -function visit94_388_1(result) { - _$jscoverage['/control.js'].branchData['388'][1].ranCondition(result); +}_$jscoverage['/control.js'].branchData['378'][1].init(99, 21, 'self.get(\'focusable\')'); +function visit95_378_1(result) { + _$jscoverage['/control.js'].branchData['378'][1].ranCondition(result); return result; -}_$jscoverage['/control.js'].branchData['376'][1].init(99, 21, 'self.get(\'focusable\')'); -function visit93_376_1(result) { - _$jscoverage['/control.js'].branchData['376'][1].ranCondition(result); +}_$jscoverage['/control.js'].branchData['366'][1].init(21, 21, '!this.get(\'disabled\')'); +function visit94_366_1(result) { + _$jscoverage['/control.js'].branchData['366'][1].ranCondition(result); return result; -}_$jscoverage['/control.js'].branchData['364'][1].init(21, 21, '!this.get(\'disabled\')'); -function visit92_364_1(result) { - _$jscoverage['/control.js'].branchData['364'][1].ranCondition(result); +}_$jscoverage['/control.js'].branchData['359'][1].init(21, 33, 'ev.keyCode === Node.KeyCode.ENTER'); +function visit93_359_1(result) { + _$jscoverage['/control.js'].branchData['359'][1].ranCondition(result); return result; -}_$jscoverage['/control.js'].branchData['357'][1].init(21, 33, 'ev.keyCode === Node.KeyCode.ENTER'); -function visit91_357_1(result) { - _$jscoverage['/control.js'].branchData['357'][1].ranCondition(result); +}_$jscoverage['/control.js'].branchData['346'][1].init(54, 55, '!this.get(\'disabled\') && self.handleKeyDownInternal(ev)'); +function visit92_346_1(result) { + _$jscoverage['/control.js'].branchData['346'][1].ranCondition(result); return result; -}_$jscoverage['/control.js'].branchData['344'][1].init(54, 55, '!this.get(\'disabled\') && self.handleKeyDownInternal(ev)'); -function visit90_344_1(result) { - _$jscoverage['/control.js'].branchData['344'][1].ranCondition(result); +}_$jscoverage['/control.js'].branchData['330'][1].init(21, 21, '!this.get(\'disabled\')'); +function visit91_330_1(result) { + _$jscoverage['/control.js'].branchData['330'][1].ranCondition(result); return result; -}_$jscoverage['/control.js'].branchData['328'][1].init(21, 21, '!this.get(\'disabled\')'); -function visit89_328_1(result) { - _$jscoverage['/control.js'].branchData['328'][1].ranCondition(result); +}_$jscoverage['/control.js'].branchData['315'][1].init(21, 21, '!this.get(\'disabled\')'); +function visit90_315_1(result) { + _$jscoverage['/control.js'].branchData['315'][1].ranCondition(result); return result; -}_$jscoverage['/control.js'].branchData['313'][1].init(21, 21, '!this.get(\'disabled\')'); -function visit88_313_1(result) { - _$jscoverage['/control.js'].branchData['313'][1].ranCondition(result); +}_$jscoverage['/control.js'].branchData['302'][1].init(21, 21, '!this.get(\'disabled\')'); +function visit89_302_1(result) { + _$jscoverage['/control.js'].branchData['302'][1].ranCondition(result); return result; -}_$jscoverage['/control.js'].branchData['300'][1].init(21, 21, '!this.get(\'disabled\')'); -function visit87_300_1(result) { - _$jscoverage['/control.js'].branchData['300'][1].ranCondition(result); +}_$jscoverage['/control.js'].branchData['296'][3].init(99, 14, 'ev.which === 1'); +function visit88_296_3(result) { + _$jscoverage['/control.js'].branchData['296'][3].ranCondition(result); return result; -}_$jscoverage['/control.js'].branchData['294'][3].init(99, 14, 'ev.which === 1'); -function visit86_294_3(result) { - _$jscoverage['/control.js'].branchData['294'][3].ranCondition(result); +}_$jscoverage['/control.js'].branchData['296'][2].init(99, 41, 'ev.which === 1 || isTouchGestureSupported'); +function visit87_296_2(result) { + _$jscoverage['/control.js'].branchData['296'][2].ranCondition(result); return result; -}_$jscoverage['/control.js'].branchData['294'][2].init(99, 41, 'ev.which === 1 || isTouchGestureSupported'); -function visit85_294_2(result) { - _$jscoverage['/control.js'].branchData['294'][2].ranCondition(result); +}_$jscoverage['/control.js'].branchData['296'][1].init(76, 65, 'self.get(\'active\') && (ev.which === 1 || isTouchGestureSupported)'); +function visit86_296_1(result) { + _$jscoverage['/control.js'].branchData['296'][1].ranCondition(result); return result; -}_$jscoverage['/control.js'].branchData['294'][1].init(76, 65, 'self.get(\'active\') && (ev.which === 1 || isTouchGestureSupported)'); -function visit84_294_1(result) { - _$jscoverage['/control.js'].branchData['294'][1].ranCondition(result); +}_$jscoverage['/control.js'].branchData['281'][1].init(21, 21, '!this.get(\'disabled\')'); +function visit85_281_1(result) { + _$jscoverage['/control.js'].branchData['281'][1].ranCondition(result); return result; -}_$jscoverage['/control.js'].branchData['279'][1].init(21, 21, '!this.get(\'disabled\')'); -function visit83_279_1(result) { - _$jscoverage['/control.js'].branchData['279'][1].ranCondition(result); +}_$jscoverage['/control.js'].branchData['273'][5].init(354, 14, 'n !== \'button\''); +function visit84_273_5(result) { + _$jscoverage['/control.js'].branchData['273'][5].ranCondition(result); return result; -}_$jscoverage['/control.js'].branchData['271'][5].init(354, 14, 'n !== \'button\''); -function visit82_271_5(result) { - _$jscoverage['/control.js'].branchData['271'][5].ranCondition(result); +}_$jscoverage['/control.js'].branchData['273'][4].init(334, 16, 'n !== \'textarea\''); +function visit83_273_4(result) { + _$jscoverage['/control.js'].branchData['273'][4].ranCondition(result); return result; -}_$jscoverage['/control.js'].branchData['271'][4].init(334, 16, 'n !== \'textarea\''); -function visit81_271_4(result) { - _$jscoverage['/control.js'].branchData['271'][4].ranCondition(result); +}_$jscoverage['/control.js'].branchData['273'][3].init(334, 34, 'n !== \'textarea\' && n !== \'button\''); +function visit82_273_3(result) { + _$jscoverage['/control.js'].branchData['273'][3].ranCondition(result); return result; -}_$jscoverage['/control.js'].branchData['271'][3].init(334, 34, 'n !== \'textarea\' && n !== \'button\''); -function visit80_271_3(result) { - _$jscoverage['/control.js'].branchData['271'][3].ranCondition(result); +}_$jscoverage['/control.js'].branchData['273'][2].init(317, 13, 'n !== \'input\''); +function visit81_273_2(result) { + _$jscoverage['/control.js'].branchData['273'][2].ranCondition(result); return result; -}_$jscoverage['/control.js'].branchData['271'][2].init(317, 13, 'n !== \'input\''); -function visit79_271_2(result) { - _$jscoverage['/control.js'].branchData['271'][2].ranCondition(result); +}_$jscoverage['/control.js'].branchData['273'][1].init(317, 51, 'n !== \'input\' && n !== \'textarea\' && n !== \'button\''); +function visit80_273_1(result) { + _$jscoverage['/control.js'].branchData['273'][1].ranCondition(result); return result; -}_$jscoverage['/control.js'].branchData['271'][1].init(317, 51, 'n !== \'input\' && n !== \'textarea\' && n !== \'button\''); -function visit78_271_1(result) { +}_$jscoverage['/control.js'].branchData['271'][1].init(188, 20, 'n && n.toLowerCase()'); +function visit79_271_1(result) { _$jscoverage['/control.js'].branchData['271'][1].ranCondition(result); return result; -}_$jscoverage['/control.js'].branchData['269'][1].init(188, 20, 'n && n.toLowerCase()'); -function visit77_269_1(result) { - _$jscoverage['/control.js'].branchData['269'][1].ranCondition(result); +}_$jscoverage['/control.js'].branchData['267'][3].init(91, 30, 'type.indexOf(\'pointer\') !== -1'); +function visit78_267_3(result) { + _$jscoverage['/control.js'].branchData['267'][3].ranCondition(result); + return result; +}_$jscoverage['/control.js'].branchData['267'][2].init(59, 28, 'type.indexOf(\'mouse\') !== -1'); +function visit77_267_2(result) { + _$jscoverage['/control.js'].branchData['267'][2].ranCondition(result); return result; -}_$jscoverage['/control.js'].branchData['265'][2].init(291, 59, 'ev.originalEvent.type.toLowerCase().indexOf(\'mouse\') !== -1'); -function visit76_265_2(result) { - _$jscoverage['/control.js'].branchData['265'][2].ranCondition(result); +}_$jscoverage['/control.js'].branchData['267'][1].init(59, 62, 'type.indexOf(\'mouse\') !== -1 || type.indexOf(\'pointer\') !== -1'); +function visit76_267_1(result) { + _$jscoverage['/control.js'].branchData['267'][1].ranCondition(result); return result; -}_$jscoverage['/control.js'].branchData['265'][1].init(256, 94, '!self.get(\'allowTextSelection\') && ev.originalEvent.type.toLowerCase().indexOf(\'mouse\') !== -1'); -function visit75_265_1(result) { - _$jscoverage['/control.js'].branchData['265'][1].ranCondition(result); +}_$jscoverage['/control.js'].branchData['266'][1].init(324, 123, '!self.get(\'allowTextSelection\') && (type.indexOf(\'mouse\') !== -1 || type.indexOf(\'pointer\') !== -1)'); +function visit75_266_1(result) { + _$jscoverage['/control.js'].branchData['266'][1].ranCondition(result); return result; }_$jscoverage['/control.js'].branchData['262'][1].init(147, 21, 'self.get(\'focusable\')'); function visit74_262_1(result) { @@ -959,14 +971,16 @@ KISSY.add(function(S, require) { self.focus(); } _$jscoverage['/control.js'].lineData[265]++; - if (visit75_265_1(!self.get('allowTextSelection') && visit76_265_2(ev.originalEvent.type.toLowerCase().indexOf('mouse') !== -1))) { - _$jscoverage['/control.js'].lineData[268]++; + var type = ev.originalEvent.type.toLowerCase(); + _$jscoverage['/control.js'].lineData[266]++; + if (visit75_266_1(!self.get('allowTextSelection') && (visit76_267_1(visit77_267_2(type.indexOf('mouse') !== -1) || visit78_267_3(type.indexOf('pointer') !== -1))))) { + _$jscoverage['/control.js'].lineData[270]++; n = ev.target.nodeName; - _$jscoverage['/control.js'].lineData[269]++; - n = visit77_269_1(n && n.toLowerCase()); _$jscoverage['/control.js'].lineData[271]++; - if (visit78_271_1(visit79_271_2(n !== 'input') && visit80_271_3(visit81_271_4(n !== 'textarea') && visit82_271_5(n !== 'button')))) { - _$jscoverage['/control.js'].lineData[272]++; + n = visit79_271_1(n && n.toLowerCase()); + _$jscoverage['/control.js'].lineData[273]++; + if (visit80_273_1(visit81_273_2(n !== 'input') && visit82_273_3(visit83_273_4(n !== 'textarea') && visit84_273_5(n !== 'button')))) { + _$jscoverage['/control.js'].lineData[274]++; ev.preventDefault(); } } @@ -974,27 +988,27 @@ KISSY.add(function(S, require) { }, handleMouseUp: function(ev) { _$jscoverage['/control.js'].functionData[23]++; - _$jscoverage['/control.js'].lineData[279]++; - if (visit83_279_1(!this.get('disabled'))) { - _$jscoverage['/control.js'].lineData[280]++; + _$jscoverage['/control.js'].lineData[281]++; + if (visit85_281_1(!this.get('disabled'))) { + _$jscoverage['/control.js'].lineData[282]++; this.handleMouseUpInternal(ev); } }, handleMouseUpInternal: function(ev) { _$jscoverage['/control.js'].functionData[24]++; - _$jscoverage['/control.js'].lineData[292]++; - var self = this; _$jscoverage['/control.js'].lineData[294]++; - if (visit84_294_1(self.get('active') && (visit85_294_2(visit86_294_3(ev.which === 1) || isTouchGestureSupported)))) { - _$jscoverage['/control.js'].lineData[295]++; + var self = this; + _$jscoverage['/control.js'].lineData[296]++; + if (visit86_296_1(self.get('active') && (visit87_296_2(visit88_296_3(ev.which === 1) || isTouchGestureSupported)))) { + _$jscoverage['/control.js'].lineData[297]++; self.set('active', false); } }, handleContextMenu: function(ev) { _$jscoverage['/control.js'].functionData[25]++; - _$jscoverage['/control.js'].lineData[300]++; - if (visit87_300_1(!this.get('disabled'))) { - _$jscoverage['/control.js'].lineData[301]++; + _$jscoverage['/control.js'].lineData[302]++; + if (visit89_302_1(!this.get('disabled'))) { + _$jscoverage['/control.js'].lineData[303]++; this.handleContextMenuInternal(ev); } }, @@ -1003,90 +1017,90 @@ KISSY.add(function(S, require) { }, handleFocus: function() { _$jscoverage['/control.js'].functionData[27]++; - _$jscoverage['/control.js'].lineData[313]++; - if (visit88_313_1(!this.get('disabled'))) { - _$jscoverage['/control.js'].lineData[314]++; + _$jscoverage['/control.js'].lineData[315]++; + if (visit90_315_1(!this.get('disabled'))) { + _$jscoverage['/control.js'].lineData[316]++; this.handleFocusInternal(); } }, handleFocusInternal: function() { _$jscoverage['/control.js'].functionData[28]++; - _$jscoverage['/control.js'].lineData[323]++; + _$jscoverage['/control.js'].lineData[325]++; this.focus(); - _$jscoverage['/control.js'].lineData[324]++; + _$jscoverage['/control.js'].lineData[326]++; this.fire('focus'); }, handleBlur: function() { _$jscoverage['/control.js'].functionData[29]++; - _$jscoverage['/control.js'].lineData[328]++; - if (visit89_328_1(!this.get('disabled'))) { - _$jscoverage['/control.js'].lineData[329]++; + _$jscoverage['/control.js'].lineData[330]++; + if (visit91_330_1(!this.get('disabled'))) { + _$jscoverage['/control.js'].lineData[331]++; this.handleBlurInternal(); } }, handleBlurInternal: function() { _$jscoverage['/control.js'].functionData[30]++; - _$jscoverage['/control.js'].lineData[338]++; + _$jscoverage['/control.js'].lineData[340]++; this.blur(); - _$jscoverage['/control.js'].lineData[339]++; + _$jscoverage['/control.js'].lineData[341]++; this.fire('blur'); }, handleKeydown: function(ev) { _$jscoverage['/control.js'].functionData[31]++; - _$jscoverage['/control.js'].lineData[343]++; + _$jscoverage['/control.js'].lineData[345]++; var self = this; - _$jscoverage['/control.js'].lineData[344]++; - if (visit90_344_1(!this.get('disabled') && self.handleKeyDownInternal(ev))) { - _$jscoverage['/control.js'].lineData[345]++; + _$jscoverage['/control.js'].lineData[346]++; + if (visit92_346_1(!this.get('disabled') && self.handleKeyDownInternal(ev))) { + _$jscoverage['/control.js'].lineData[347]++; ev.halt(); - _$jscoverage['/control.js'].lineData[346]++; + _$jscoverage['/control.js'].lineData[348]++; return true; } - _$jscoverage['/control.js'].lineData[348]++; + _$jscoverage['/control.js'].lineData[350]++; return undefined; }, handleKeyDownInternal: function(ev) { _$jscoverage['/control.js'].functionData[32]++; - _$jscoverage['/control.js'].lineData[357]++; - if (visit91_357_1(ev.keyCode === Node.KeyCode.ENTER)) { - _$jscoverage['/control.js'].lineData[358]++; + _$jscoverage['/control.js'].lineData[359]++; + if (visit93_359_1(ev.keyCode === Node.KeyCode.ENTER)) { + _$jscoverage['/control.js'].lineData[360]++; return this.handleClickInternal(ev); } - _$jscoverage['/control.js'].lineData[360]++; + _$jscoverage['/control.js'].lineData[362]++; return undefined; }, handleClick: function(ev) { _$jscoverage['/control.js'].functionData[33]++; - _$jscoverage['/control.js'].lineData[364]++; - if (visit92_364_1(!this.get('disabled'))) { - _$jscoverage['/control.js'].lineData[365]++; + _$jscoverage['/control.js'].lineData[366]++; + if (visit94_366_1(!this.get('disabled'))) { + _$jscoverage['/control.js'].lineData[367]++; this.handleClickInternal(ev); } }, handleClickInternal: function() { _$jscoverage['/control.js'].functionData[34]++; - _$jscoverage['/control.js'].lineData[375]++; + _$jscoverage['/control.js'].lineData[377]++; var self = this; - _$jscoverage['/control.js'].lineData[376]++; - if (visit93_376_1(self.get('focusable'))) { - _$jscoverage['/control.js'].lineData[377]++; + _$jscoverage['/control.js'].lineData[378]++; + if (visit95_378_1(self.get('focusable'))) { + _$jscoverage['/control.js'].lineData[379]++; self.focus(); } }, destructor: function() { _$jscoverage['/control.js'].functionData[35]++; - _$jscoverage['/control.js'].lineData[385]++; - var self = this; _$jscoverage['/control.js'].lineData[387]++; + var self = this; + _$jscoverage['/control.js'].lineData[389]++; Manager.removeComponent(self.get('id')); - _$jscoverage['/control.js'].lineData[388]++; - if (visit94_388_1(self.view)) { - _$jscoverage['/control.js'].lineData[389]++; + _$jscoverage['/control.js'].lineData[390]++; + if (visit96_390_1(self.view)) { + _$jscoverage['/control.js'].lineData[391]++; self.view.destroy(); } else { - _$jscoverage['/control.js'].lineData[390]++; - if (visit95_390_1(self.get('srcNode'))) { - _$jscoverage['/control.js'].lineData[391]++; + _$jscoverage['/control.js'].lineData[392]++; + if (visit97_392_1(self.get('srcNode'))) { + _$jscoverage['/control.js'].lineData[393]++; self.get('srcNode').remove(); } } @@ -1097,7 +1111,7 @@ KISSY.add(function(S, require) { view: 1, valueFn: function() { _$jscoverage['/control.js'].functionData[36]++; - _$jscoverage['/control.js'].lineData[402]++; + _$jscoverage['/control.js'].lineData[404]++; return S.guid('ks-component'); }}, content: { @@ -1112,13 +1126,13 @@ KISSY.add(function(S, require) { value: [], setter: function(v) { _$jscoverage['/control.js'].functionData[37]++; - _$jscoverage['/control.js'].lineData[466]++; - if (visit96_466_1(typeof v === 'string')) { - _$jscoverage['/control.js'].lineData[467]++; + _$jscoverage['/control.js'].lineData[468]++; + if (visit98_468_1(typeof v === 'string')) { + _$jscoverage['/control.js'].lineData[469]++; v = v.split(/\s+/); } - _$jscoverage['/control.js'].lineData[469]++; - return visit97_469_1(v || []); + _$jscoverage['/control.js'].lineData[471]++; + return visit99_471_1(v || []); }}, elStyle: { view: 1, @@ -1130,9 +1144,9 @@ KISSY.add(function(S, require) { el: { setter: function(el) { _$jscoverage['/control.js'].functionData[38]++; - _$jscoverage['/control.js'].lineData[519]++; + _$jscoverage['/control.js'].lineData[521]++; this.$el = el; - _$jscoverage['/control.js'].lineData[520]++; + _$jscoverage['/control.js'].lineData[522]++; this.el = el[0]; }}, x: {}, @@ -1140,27 +1154,27 @@ KISSY.add(function(S, require) { xy: { setter: function(v) { _$jscoverage['/control.js'].functionData[39]++; - _$jscoverage['/control.js'].lineData[565]++; - var self = this, xy = S.makeArray(v); _$jscoverage['/control.js'].lineData[567]++; - if (visit98_567_1(xy.length)) { - _$jscoverage['/control.js'].lineData[568]++; - if (visit99_568_1(xy[0] !== undefined)) { - _$jscoverage['/control.js'].lineData[569]++; + var self = this, xy = S.makeArray(v); + _$jscoverage['/control.js'].lineData[569]++; + if (visit100_569_1(xy.length)) { + _$jscoverage['/control.js'].lineData[570]++; + if (visit101_570_1(xy[0] !== undefined)) { + _$jscoverage['/control.js'].lineData[571]++; self.set('x', xy[0]); } - _$jscoverage['/control.js'].lineData[571]++; - if (visit100_571_1(xy[1] !== undefined)) { - _$jscoverage['/control.js'].lineData[572]++; + _$jscoverage['/control.js'].lineData[573]++; + if (visit102_573_1(xy[1] !== undefined)) { + _$jscoverage['/control.js'].lineData[574]++; self.set('y', xy[1]); } } - _$jscoverage['/control.js'].lineData[575]++; + _$jscoverage['/control.js'].lineData[577]++; return v; }, getter: function() { _$jscoverage['/control.js'].functionData[40]++; - _$jscoverage['/control.js'].lineData[578]++; + _$jscoverage['/control.js'].lineData[580]++; return [this.get('x'), this.get('y')]; }}, zIndex: { @@ -1173,7 +1187,7 @@ KISSY.add(function(S, require) { srcNode: { setter: function(v) { _$jscoverage['/control.js'].functionData[41]++; - _$jscoverage['/control.js'].lineData[645]++; + _$jscoverage['/control.js'].lineData[647]++; return Node.all(v); }}, handleMouseEvents: { @@ -1195,19 +1209,19 @@ KISSY.add(function(S, require) { value: false}, prefixCls: { view: 1, - value: visit101_766_1(S.config('component/prefixCls') || 'ks-')}, + value: visit103_768_1(S.config('component/prefixCls') || 'ks-')}, prefixXClass: {}, parent: { setter: function(p, prev) { _$jscoverage['/control.js'].functionData[42]++; - _$jscoverage['/control.js'].lineData[794]++; + _$jscoverage['/control.js'].lineData[796]++; if ((prev = this.get('parent'))) { - _$jscoverage['/control.js'].lineData[795]++; + _$jscoverage['/control.js'].lineData[797]++; this.removeTarget(prev); } - _$jscoverage['/control.js'].lineData[797]++; - if (visit102_797_1(p)) { - _$jscoverage['/control.js'].lineData[798]++; + _$jscoverage['/control.js'].lineData[799]++; + if (visit104_799_1(p)) { + _$jscoverage['/control.js'].lineData[800]++; this.addTarget(p); } }}, @@ -1219,50 +1233,50 @@ KISSY.add(function(S, require) { view: { setter: function(v) { _$jscoverage['/control.js'].functionData[43]++; - _$jscoverage['/control.js'].lineData[834]++; + _$jscoverage['/control.js'].lineData[836]++; this.view = v; }}}}); - _$jscoverage['/control.js'].lineData[840]++; + _$jscoverage['/control.js'].lineData[842]++; function getDefaultRender() { _$jscoverage['/control.js'].functionData[44]++; - _$jscoverage['/control.js'].lineData[841]++; - var attrs, constructor = this; _$jscoverage['/control.js'].lineData[843]++; + var attrs, constructor = this; + _$jscoverage['/control.js'].lineData[845]++; do { - _$jscoverage['/control.js'].lineData[844]++; + _$jscoverage['/control.js'].lineData[846]++; attrs = constructor.ATTRS; - _$jscoverage['/control.js'].lineData[845]++; + _$jscoverage['/control.js'].lineData[847]++; constructor = constructor.superclass; - } while (visit103_846_1(!attrs || !attrs.xrender)); - _$jscoverage['/control.js'].lineData[847]++; + } while (visit105_848_1(!attrs || !attrs.xrender)); + _$jscoverage['/control.js'].lineData[849]++; return attrs.xrender.value; } - _$jscoverage['/control.js'].lineData[850]++; + _$jscoverage['/control.js'].lineData[852]++; Control.getDefaultRender = getDefaultRender; - _$jscoverage['/control.js'].lineData[871]++; + _$jscoverage['/control.js'].lineData[873]++; Control.extend = function extend(extensions, px, sx) { _$jscoverage['/control.js'].functionData[45]++; - _$jscoverage['/control.js'].lineData[873]++; + _$jscoverage['/control.js'].lineData[875]++; var args = S.makeArray(arguments), baseClass = this, xclass, newClass, argsLen = args.length, last = args[argsLen - 1]; - _$jscoverage['/control.js'].lineData[880]++; + _$jscoverage['/control.js'].lineData[882]++; if ((xclass = last.xclass)) { - _$jscoverage['/control.js'].lineData[881]++; + _$jscoverage['/control.js'].lineData[883]++; last.name = xclass; } - _$jscoverage['/control.js'].lineData[884]++; - newClass = ComponentProcess.extend.apply(baseClass, args); _$jscoverage['/control.js'].lineData[886]++; - if (visit104_886_1(xclass)) { - _$jscoverage['/control.js'].lineData[887]++; + newClass = ComponentProcess.extend.apply(baseClass, args); + _$jscoverage['/control.js'].lineData[888]++; + if (visit106_888_1(xclass)) { + _$jscoverage['/control.js'].lineData[889]++; Manager.setConstructorByXClass(xclass, newClass); } - _$jscoverage['/control.js'].lineData[890]++; + _$jscoverage['/control.js'].lineData[892]++; newClass.extend = extend; - _$jscoverage['/control.js'].lineData[891]++; - newClass.getDefaultRender = getDefaultRender; _$jscoverage['/control.js'].lineData[893]++; + newClass.getDefaultRender = getDefaultRender; + _$jscoverage['/control.js'].lineData[895]++; return newClass; }; - _$jscoverage['/control.js'].lineData[896]++; + _$jscoverage['/control.js'].lineData[898]++; return Control; }); diff --git a/src/component/sub-modules/control/src/control.js b/src/component/sub-modules/control/src/control.js index 8429d25743..0699706f97 100644 --- a/src/component/sub-modules/control/src/control.js +++ b/src/component/sub-modules/control/src/control.js @@ -262,7 +262,9 @@ KISSY.add(function (S, require) { if (self.get('focusable')) { self.focus(); } - if (!self.get('allowTextSelection') && ev.originalEvent.type.toLowerCase().indexOf('mouse') !== -1) { + var type = ev.originalEvent.type.toLowerCase(); + if (!self.get('allowTextSelection') && + (type.indexOf('mouse') !== -1 || type.indexOf('pointer') !== -1)) { // firefox /chrome/ie9/i10 不会引起焦点转移 // invalid for ie10 buggy? n = ev.target.nodeName;