fixed creating or deleting favorites in calendar does not work: was caused by sidebox not initialised as not yet loaded, now calling _init_sidebox from framework, also need to add a click handler for favorites as initialising sidebox removes one installed from template

This commit is contained in:
Ralf Becker 2014-02-13 15:37:49 +00:00
parent 7386333c10
commit 3a5ece79a7

View File

@ -298,6 +298,15 @@ var AppJS = Class.extend(
.on("mouseenter","div.ui-icon-trash", function() {$j(this).wrap("<span class='ui-state-active'/>");})
.on("mouseleave","div.ui-icon-trash", function() {$j(this).unwrap();})
.on("click","div.ui-icon-trash", this, this.delete_favorite)
// need to install a favorite handler, as we switch original one off with .off()
.on('click','li[data-id]', this, function(){
var href = jQuery('a[href^="javascript:"]', this).prop('href');
var matches = href.match(/^javascript:([^\(]+)\((.*)?\);?$/);
if (matches.length > 1 && matches[2] !== undefined)
{
return self.setState.call(self, JSON.parse(matches[2]));
}
})
.addClass("ui-helper-clearfix");
return true;
}