1
0
Fork 0
oldhaven/public/js/jquery/jquery.contentchange.js

19 lines
438 B
JavaScript

(function(){
var interval;
jQuery.event.special.contentchange = {
setup: function() {
var self = this,
$this = $(this),
$originalContent = $this.text();
interval = setInterval(function() {
if ($originalContent != $this.text()) {
$originalContent = $this.text();
jQuery.event.handle.call(self, {type:'contentchange'});
}
}, 100);
},
teardown: function() {
clearInterval(interval);
}
};
})();