mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-09-06 09:41:36 +02:00
40 lines
802 B
JavaScript
40 lines
802 B
JavaScript
|
(function($) {
|
||
|
|
||
|
$.entwine('ss', function($){
|
||
|
|
||
|
$('.LeftAndMain .cms-content').entwine({
|
||
|
|
||
|
redraw: function() {
|
||
|
},
|
||
|
|
||
|
cleanup: function() {
|
||
|
this.empty();
|
||
|
},
|
||
|
|
||
|
loadPanel: function(url, callback, ajaxOptions) {
|
||
|
var self = this;
|
||
|
|
||
|
this.trigger('load', {url: url, args: arguments});
|
||
|
|
||
|
this.cleanup();
|
||
|
|
||
|
// TODO Add browser history support
|
||
|
return $.ajax($.extend({
|
||
|
url: url,
|
||
|
complete: function(xmlhttp, status) {
|
||
|
self.loadPanel_onSuccess(xmlhttp.responseText, status, xmlhttp);
|
||
|
self.removeClass('loading');
|
||
|
|
||
|
if(callback) callback.apply(self, arguments);
|
||
|
},
|
||
|
dataType: 'html'
|
||
|
}, ajaxOptions));
|
||
|
},
|
||
|
|
||
|
loadPanel_onSuccess: function(html, status, xmlhttp) {
|
||
|
this.html(html);
|
||
|
this.redraw();
|
||
|
}
|
||
|
});
|
||
|
});
|
||
|
})(jQuery);
|