Skip to content
This repository has been archived by the owner on Apr 27, 2022. It is now read-only.

Commit

Permalink
Merge pull request erik168#14 from mytharcher/fix-Select
Browse files Browse the repository at this point in the history
修复Select点击当前选项不应该触发onchange事件的问题
  • Loading branch information
leeight committed Jul 21, 2012
2 parents 566b70e + 9d92174 commit 15e23cd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/esui/Select.js
Original file line number Diff line number Diff line change
Expand Up @@ -488,15 +488,15 @@ esui.Select.prototype = {
* @param {HTMLElement} item 选项
*/
_itemClickHandler: function ( item ) {
var index = item.getAttribute( 'index' );
var index = parseInt( item.getAttribute( 'index' ), 10 );
var disabled = item.getAttribute( 'dis' );

if ( disabled == 1 ) {
return;
}

this.hideLayer();
this.setSelectedIndex( parseInt( index, 10 ), true );
this.setSelectedIndex( index, index != this.selectedIndex );
},

/**
Expand Down

0 comments on commit 15e23cd

Please sign in to comment.