Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #9 from leeight/fix-issue-7
FIX issue#7
  • Loading branch information
leeight committed Jul 2, 2012
2 parents 4f22e5c + 9e66272 commit b56019a
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/esui/Button.js
Expand Up @@ -124,7 +124,9 @@ esui.Button.prototype = {
var me = this;
return function ( e ) {
if ( !me.isDisabled() ) {
me.onclick();
if (false === me.onclick()) {
baidu.event.stop(e || window.event);
}
}
};
},
Expand Down
5 changes: 4 additions & 1 deletion src/esui/css/ui-button.css
Expand Up @@ -75,6 +75,9 @@
border-color:#cfcfcf;
color:#999;
}
.ui-button-disabled .ui-button-label {
cursor: default;
}

/* 高亮按钮 */
.skin-button-em-label {
Expand Down Expand Up @@ -191,4 +194,4 @@
}
.skin-button-layerclose-press {
background:url(img/esui.png) -25px -88px;
}
}
17 changes: 17 additions & 0 deletions test/esui/button.html
Expand Up @@ -43,6 +43,19 @@
<td>button 标签</td>
<td><button ui="type:Button;id:myBtn5;">请按我</button></td>
</tr>
<tr>
<td>button 标签</td>
<td><button ui="type:Button;id:myBtn6;">请按我</button></td>
</tr>
<tr>
<td>submit button</td>
<td>
<form>
<input type="submit" ui="type:Button;id:myBtn7;" value="请按我"/>
</form>
</td>
</tr>
</table>
</table>
</div>

Expand All @@ -55,6 +68,10 @@
esui.get( 'myBtn5' ).onclick = function () {
alert( '我是按钮:' + this.id );
};
esui.get( 'myBtn6' ).setDisabled(true);
esui.get( 'myBtn7' ).onclick = function() {
return false;
}
</script>
</body>
</html>

0 comments on commit b56019a

Please sign in to comment.