Releader class

This commit is contained in:
Ruud
2014-07-13 12:23:27 +02:00
parent 6ccbad031f
commit 4291e2233d
+24
View File
@@ -0,0 +1,24 @@
var ReloaderBase = new Class({
initialize: function(){
var self = this;
App.on('watcher.changed', self.reloadFile.bind(self))
},
reloadFile: function(data){
var self = this,
urls = data.data;
urls.each(function(url){
var without_timestamp = url.split('?')[0],
old_links = document.getElement('[data-url^=\''+without_timestamp+'\']');
old_links.set('href', old_links.get('href') + 1)
})
}
});
var Reloader = new ReloaderBase();