Last active
October 27, 2015 15:38
-
-
Save atelic/b7268a91248c05d03fd8 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// Bind Bootstrap Progress | |
ko.bindingHandlers.progress = { | |
init: function (element, valueAccessor) { | |
var $element = $(element); | |
var bar = $('<div/>', { | |
'class': 'progress-bar', | |
'role': 'progressbar', | |
'aria-valuemin': 0, | |
'aria-valuemax': 100, | |
'aria-valuenow': valueAccessor(), | |
'data-bind': 'style: { width:' + valueAccessor() + '% }' | |
}); | |
$element.addClass('progress progress-info') | |
.append(bar); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment