diff --git a/src/plugins/projekktor.contextmenu.js b/src/plugins/projekktor.contextmenu.js index 4dc4aa8..712fbd4 100644 --- a/src/plugins/projekktor.contextmenu.js +++ b/src/plugins/projekktor.contextmenu.js @@ -13,7 +13,7 @@ projekktorContextmenu.prototype = { _dest: null, _items: {}, - + initialize: function() { var ref = this, target = this.pp.getIframeWindow() || $(window); @@ -25,12 +25,13 @@ projekktorContextmenu.prototype = { }, open: function() { if (ref.getConfig('playerHome')!=null) { - target.get(0).location.href = ref.getConfig('playerHome'); + // target.get(0).location.href = ref.getConfig('playerHome'); + target.get(0).open(ref.getConfig('playerHome'), 'projekktor'); ref.pp.setPause(); } - } + } } - + if (this.pp.getConfig('helpHome')) { this._items['help'] = { getContextTitle: function() { @@ -38,41 +39,41 @@ projekktorContextmenu.prototype = { }, open: function() { ref.popup(ref.pp.getConfig('helpHome'), 400, 600); - } - } + } + } } - + this.pluginReady = true; }, - - mousedownHandler: function(evt) { + + mousedownHandler: function(evt) { switch (evt.which) { case 3: var parentOffset = this.pp.getDC().offset(), yPos = (evt.pageY - parentOffset.top), xPos = (evt.pageX - parentOffset.left); - + if (xPos + this._dest.width() > this.pp.getDC().width()) xPos = this.pp.getDC().width() - this._dest.width() - 2; - + if (yPos + this._dest.height() > this.pp.getDC().height()) yPos = this.pp.getDC().height() - this._dest.height() - 2; - - this.setActive(); + + this.setActive(); this._dest.css({ top: yPos + "px", left: xPos+ "px" }) break; - case 1: + case 1: try { this._items[$(evt.target).data('plugin')].open(); } catch(e) {} - default: + default: this.setInactive(); - } + } }, - + mouseleaveHandler: function() { this.setInactive(); }, @@ -82,31 +83,31 @@ projekktorContextmenu.prototype = { if (this._items[obj.name]==null) { this._items[obj.name] = obj; } - } + } }, - + displayReadyHandler: function() { var ref = this, span = null; - + this.setInactive(); - this._dest.html(''); - + this._dest.html(''); + for (var i in this._items) { - + span = $('') .data('plugin', i) .html(this._items[i].getContextTitle() || i); - + try{this._items[i].setContextEntry(span);}catch(e){} - - $('
  • ') + + $('
  • ') .append(span) .data('plugin', i) - .appendTo(this._dest) + .appendTo(this._dest) } }, - + popup: function(url, width, height) { centeredY = window.screenY + (((window.outerHeight/2) - (height/2))); centeredX = window.screenX + (((window.outerWidth/2) - (width/2)));