Changed how the "LFA upload" dialog is sized.

master
Pacman Ghost 4 years ago
parent 4e3ee7d08c
commit ac62b9b98a
  1. 9
      vasl_templates/webapp/static/lfa-upload.js
  2. 9
      vasl_templates/webapp/static/utils.js

@ -2,7 +2,6 @@
var $gLogFilesToUpload ; var $gLogFilesToUpload ;
var gEventHandlers ; var gEventHandlers ;
var gDlgSizeAndPosition = {} ;
var gDisableClickToAddTimestamp = new Date() ; var gDisableClickToAddTimestamp = new Date() ;
// -------------------------------------------------------------------- // --------------------------------------------------------------------
@ -85,9 +84,9 @@ window.on_analyze_vlog = function()
title: "Analyze log files", title: "Analyze log files",
dialogClass: "lfa-upload", dialogClass: "lfa-upload",
modal: true, modal: true,
width: Math.min( gDlgSizeAndPosition.width || 400, $(window).innerWidth() ), width: $(window).innerWidth() / 2,
minWidth: 400, minWidth: 400,
height: Math.min( gDlgSizeAndPosition.height || 300, $(window).innerHeight() ), height: $(window).innerHeight() / 2,
minHeight: 300, minHeight: 300,
position: { my: "center", at: "center", of: window }, position: { my: "center", at: "center", of: window },
create: function() { create: function() {
@ -111,10 +110,6 @@ window.on_analyze_vlog = function()
gEventHandlers.addHandler( $dlg.find(".hint"), "click", onAddFile ) ; gEventHandlers.addHandler( $dlg.find(".hint"), "click", onAddFile ) ;
updateUi() ; updateUi() ;
}, },
beforeClose: function() {
// save the current size and position
gDlgSizeAndPosition = getElemSizeAndPosition( $(".ui-dialog.lfa-upload") ) ;
},
close: function() { close: function() {
// clean up handlers // clean up handlers
gEventHandlers.cleanUp() ; gEventHandlers.cleanUp() ;

@ -452,15 +452,6 @@ function get_month_name( month )
// -------------------------------------------------------------------- // --------------------------------------------------------------------
function getElemSizeAndPosition( $elem )
{
// return the element's size and position
return {
width: $elem.width(), height: $elem.height(),
left: $elem.offset().left, top: $elem.offset().top,
} ;
}
function fixup_external_links( $root ) function fixup_external_links( $root )
{ {
// NOTE: We want to open externals links in a new browser window, but simply adding target="_blank" // NOTE: We want to open externals links in a new browser window, but simply adding target="_blank"

Loading…
Cancel
Save