Created
December 18, 2012 14:33
-
-
Save sepulchered/4328475 to your computer and use it in GitHub Desktop.
This function generates progressbar html layout.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
progressBarHtmlGenerator: (function(){ | |
var width = progressbar_width, | |
cls = 'x-progress', // default class as you can see in ProgressBar.js of Ext.js | |
tpl = new Ext.Template( // this template also was taken from ProgressBar.js | |
'<div class="{cls}-wrap">', | |
'<div class="{cls}-inner">', | |
'<div class="{cls}-bar" style="width: {barWidth}px">', | |
'<div class="{cls}-text">', | |
'<div>{text}</div>', | |
'</div>', | |
'</div>', | |
'<div class="{cls}-text {cls}-text-back">', | |
'<div>{textBack}</div>', | |
'</div>', | |
'</div>', | |
'</div>' | |
); | |
return function(value, text, textBack){ | |
return tpl.apply({ | |
cls: cls, | |
barWidth: value*width || 0, | |
text: text || ' ', | |
textBack: textBack || ' ' | |
}) | |
} | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment