Releader class
This commit is contained in:
1 parent
6ccbad031f
commit
4291e2233d
1 file changed
+24
@@ -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();
|
||||||
Reference in new issue
Block a user