forked from jquery/jquery-ui
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjquery.ya.button0.js
More file actions
45 lines (43 loc) · 980 Bytes
/
jquery.ya.button0.js
File metadata and controls
45 lines (43 loc) · 980 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/**
* @author 13
*/
(function($,root){
var ya=root.ya,
sl=ya.sl,
regx=ya.regx,
uihelper=ya.uihelper,
Solution=sl.Solution;
var Base=$.ui.button;
$.widget('ya.button0',Base,{
options: {
advancedTheme:{ //设置widget的高级主题效果
shadow:false, //设置背景阴影,默认存在
corner:false
},
cls:null
},
_create:function(){
var self=this,
options=self.options,
cls=options.cls,
advancedTheme=options.advancedTheme;
Base.prototype._create.call(this);
//为buttonElement提供特殊的class
if(cls){
var textCls="";
cls.replace(regx.rword,function(v){
textCls+=v+"-text ";
});
}
self.buttonElement.addClass(cls);
$('.ui-button-text',self.buttonElement).addClass(textCls);
if(advancedTheme){
for(var n in advancedTheme){
if(advancedTheme[n]){
uihelper.advancedThemeH(self,n,$('.ui-button-text',self.buttonElement));
}
}
}
}
});
}(jQuery,this));