* End of javascript refactoring: both editors, history and gallery work as expected.
[redakcja.git] / platforma / static / js / wiki / diff_view.js
index 3eafd13..d6e71a6 100644 (file)
@@ -1,8 +1,11 @@
 (function($){
        
        function DiffPerspective(options) {
-               var old_callback = options.callback || function() {};        
+               var old_callback = options.callback || function() {};
+               var self = this;
+                       
         options.callback = function(){
+                       self.base_id = options.base_id;                 
                        old_callback.call(this);
                };              
                
         // must 
     };
        
+       DiffPerspective.prototype.destroy = function() {
+               $('#' + this.base_id).remove();
+               $('#' + this.perspective_id).remove();
+       };
+       
        DiffPerspective.prototype.onEnter = function(success, failure){
                $.wiki.Perspective.prototype.onEnter.call(this);
-               
                console.log("Entered diff view");
        };