X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/5bbc488088e1d46bd14ebf9a96852f8ee8b231a2..d899260600ea4936bf7ed9c9534d8437d0ad7523:/redakcja/static/js/wiki/view_summary.js diff --git a/redakcja/static/js/wiki/view_summary.js b/redakcja/static/js/wiki/view_summary.js index de6fcf15..55b9e53b 100644 --- a/redakcja/static/js/wiki/view_summary.js +++ b/redakcja/static/js/wiki/view_summary.js @@ -1,11 +1,34 @@ (function($){ function SummaryPerspective(options) { + var old_callback = options.callback || function() {}; + + options.callback = function() { + var self = this; + + // first time page is rendered + $('#summary-cover-refresh').click(function() { + self.refreshCover(); + }); + + old_callback.call(this); + }; + $.wiki.Perspective.call(this, options); - }; + } SummaryPerspective.prototype = new $.wiki.Perspective(); + SummaryPerspective.prototype.refreshCover = function() { + $('#summary-cover-refresh').attr('disabled', 'disabled'); + this.doc.refreshCover({ + success: function(text) { + $('#summary-cover').attr('src', text); + $('#summary-cover-refresh').removeAttr('disabled'); + } + }); + }; + SummaryPerspective.prototype.showCharCount = function() { var cc; try {