-function loadPanel(target, url) {
- $.log('ajax', url, 'into', target);
- $('.change-notification', $(target).parent()).fadeOut();
- $(document).trigger('panel:unload', target);
+function Panel(target) {
+ var self = this;
+ this.target = target;
+ this.instanceId = Math.ceil(Math.random() * 1000000000);
+ $.log('new panel - target: ', this.target);
+ $(document).bind('panel:unload.' + this.instanceId,
+ function(event, data) { self.unload(event, data); });
+}
+
+Panel.prototype.load = function (url) {
+ $.log('preparing xhr load: ', this.target);
+ $('.change-notification', $(this.target).parent()).fadeOut();
+ $(document).trigger('panel:unload', this.target);
+ var self = this;
+