Skip to content

Commit

Permalink
modal width: add signItModalWidth() switch
Browse files Browse the repository at this point in the history
  • Loading branch information
hugolpz committed Dec 7, 2023
1 parent a2d43c6 commit 7c45c48
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
1 change: 0 additions & 1 deletion content_scripts/signit.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
/* Popup outline ************************************************* */
.signit-popup {
z-index: 9999;
width:850px;
} /* above everythings */

.signit-popup .oo-ui-popupWidget-popup {
Expand Down
13 changes: 12 additions & 1 deletion content_scripts/signit.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@
/* *************************************************************** */
/* Modal: init helped by SignItCoreContent *********************** */
async function initModalUI() {

// Banana test, search `bananaInStore` in files for more
console.log("before")
var BetterBanana = await browser.storage.local.get( 'bananaInStore' );
console.log("after: BetterBanana = ", BetterBanana.bananaInStore)
Expand Down Expand Up @@ -193,12 +195,21 @@
$selector.css( 'width', coords.width );
$selector.css( 'height', coords.height );
}
// SignIt modal width depends on number of active panels
var signItModalWidth = async function(){
var showvideo = Object.values( await browser.storage.local.get( 'showvideo' ) )[0];
numberOfPanels = (showvideo?1:0)+1;
return numberOfPanels==2? 850:450;
}

var refreshModal = function(message){
// Hide the popup if it was still open for a previous request
// Hide the popup if still open from a previous request
popup.toggle( false );
// refresh with new content, panels check, width.
content.refresh( message.text, message.files );
toggleVideoPanel();
$( 'signit-popup').css( 'width', signItModalWidth() );
// Show again
popup.toggle( true );
popup.toggleClipping( false );
}
Expand Down

0 comments on commit 7c45c48

Please sign in to comment.