1
0
Fork 0
fgdata/Phi/topics/Tools/Stopwatch.js

35 lines
836 B
JavaScript
Raw Normal View History

2015-02-18 11:31:00 +00:00
define([
2015-03-17 09:41:04 +00:00
'jquery', 'knockout', 'text!./Stopwatch.html', 'jquery-ui/dialog', 'kojqui/button'
2015-02-18 11:31:00 +00:00
], function(jquery, ko, htmlString) {
function ViewModel(params) {
var self = this;
self.watches = ko.observableArray([]);
2015-02-18 11:31:00 +00:00
self.addWatch = function() {
self.watches.push(self.watches().length);
}
2015-03-17 09:41:04 +00:00
self.toDialog = function(a,evt) {
var p = jquery(evt.target).parent();
p.next().dialog({
title: p.text(),
closeOnEscape: false,
});
p.remove();
}
self.addWatch();
2015-02-18 11:31:00 +00:00
}
ViewModel.prototype.dispose = function() {
}
// Return component definition
return {
viewModel : ViewModel,
template : htmlString
};
});