Permalink
Browse files

マルチディスプレイ環境でプライマリのディスプレイにしかポップアップが表示されない問題を修正

git-svn-id: http://www.cozmixng.org/repos/piro/tabcatalog/trunk@6361 599a83e7-65a4-db11-8015-0010dcdd6dc2
  • Loading branch information...
piro
piro committed Mar 23, 2010
1 parent 020f63b commit b746664d8dcc37a311c71de921a7978a9a1f3ad6
Showing with 10 additions and 6 deletions.
  1. +10 −6 content/tabcatalog/tabcatalog.js
@@ -234,13 +234,17 @@ var TabCatalog = {
},
set shown(val) {
if (val) {
+ let currentSize = screen.availWidth+'x'+screen.availHeight;
+ if (this.panel.lastScreenSize != currentSize)
+ this.rebuildRequest = true;
this.panel.setAttribute('width', this.panelWidth);
this.panel.setAttribute('height', this.panelHeight);
this.panel.openPopupAtScreen(
- (window.screen.availWidth - this.panelWidth) / 2,
- (window.screen.availHeight - this.panelHeight) / 2,
+ ((screen.availWidth - this.panelWidth) / 2) + screen.availLeft,
+ ((screen.availHeight - this.panelHeight) / 2) + screen.availTop,
false
);
+ this.panel.lastScreenSize = currentSize;
}
else {
this.panel.hidePopup();
@@ -252,17 +256,17 @@ var TabCatalog = {
{
var max = this.maxMargin;
if (max < 0)
- max = window.screen.availWidth * this.marginFactor;
+ max = screen.availWidth * this.marginFactor;
var margin = Math.max(this.minMargin, max);
- return parseInt(max - (margin * 2));
+ return parseInt(screen.availWidth - (margin * 2));
},
get panelHeight()
{
var max = this.maxMargin;
if (max < 0)
- max = window.screen.availHeight * this.marginFactor;
+ max = screen.availHeight * this.marginFactor;
var margin = Math.max(this.minMargin, max);
- return parseInt(max - (margin * 2));
+ return parseInt(screen.availHeight - (margin * 2));
},
marginFactor : 0.16,

0 comments on commit b746664

Please sign in to comment.