mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-14 00:24:40 +00:00
remove function for checking for sessionStorage
This commit is contained in:
parent
b2f0465cec
commit
062bdb294d
@ -39,21 +39,7 @@
|
||||
function htmlDecode(value) {
|
||||
return $("<textarea/>").html(value).text();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check if sessionStorage is available
|
||||
*
|
||||
* @return boolean if sessionStorage is available.
|
||||
*/
|
||||
function checkSessionStorageExists() {
|
||||
if ('sessionStorage' in window) {
|
||||
if (window.sessionStorage != null) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
@ -255,7 +241,7 @@ function watchScrollPosition() {
|
||||
}
|
||||
|
||||
// link on scroll event handler
|
||||
if (checkSessionStorageExists()) {
|
||||
if (window.sessionStorage) {
|
||||
$(window).scroll(function(){
|
||||
sessionStorage.setItem('scrollpos', current_location()+"|"+$(window).scrollTop());
|
||||
});
|
||||
|
||||
@ -244,7 +244,7 @@ function initFormHelpUI() {
|
||||
$('[id*="show_all_help"]').toggleClass("fa-toggle-on fa-toggle-off");
|
||||
$('[id*="show_all_help"]').toggleClass("text-success text-danger");
|
||||
if ($('[id*="show_all_help"]').hasClass("fa-toggle-on")) {
|
||||
if (checkSessionStorageExists()) {
|
||||
if (window.sessionStorage) {
|
||||
sessionStorage.setItem('all_help_preset', 1);
|
||||
}
|
||||
$('[for*="help_for"]').addClass("show");
|
||||
@ -252,13 +252,13 @@ function initFormHelpUI() {
|
||||
} else {
|
||||
$('[for*="help_for"]').addClass("hidden");
|
||||
$('[for*="help_for"]').removeClass("show");
|
||||
if (checkSessionStorageExists()) {
|
||||
if (window.sessionStorage) {
|
||||
sessionStorage.setItem('all_help_preset', 0);
|
||||
}
|
||||
}
|
||||
event.preventDefault();
|
||||
});
|
||||
if (checkSessionStorageExists() && sessionStorage.getItem('all_help_preset') == 1) {
|
||||
if (window.sessionStorage && sessionStorage.getItem('all_help_preset') == 1) {
|
||||
// show all help messages when preset was stored
|
||||
$('[id*="show_all_help"]').toggleClass("fa-toggle-on fa-toggle-off");
|
||||
$('[id*="show_all_help"]').toggleClass("text-success text-danger");
|
||||
@ -271,7 +271,7 @@ function initFormHelpUI() {
|
||||
* handle advanced show/hide
|
||||
*/
|
||||
function initFormAdvancedUI() {
|
||||
if (checkSessionStorageExists() && sessionStorage.getItem('show_advanced_preset') == 1) {
|
||||
if (window.sessionStorage && sessionStorage.getItem('show_advanced_preset') == 1) {
|
||||
// show advanced options when preset was stored
|
||||
$('[id*="show_advanced"]').toggleClass("fa-toggle-on fa-toggle-off");
|
||||
$('[id*="show_advanced"]').toggleClass("text-success text-danger");
|
||||
@ -287,12 +287,12 @@ function initFormAdvancedUI() {
|
||||
if ($('[id*="show_advanced"]').hasClass("fa-toggle-on")) {
|
||||
$('[data-advanced*="true"]').show();
|
||||
$('[data-advanced*="hidden_row"]').remove(); // the table row is deleted to keep correct table striping
|
||||
if (checkSessionStorageExists()) {
|
||||
if (window.sessionStorage) {
|
||||
sessionStorage.setItem('show_advanced_preset', 1);
|
||||
}
|
||||
} else {
|
||||
$('[data-advanced*="true"]').after("<tr data-advanced='hidden_row'></tr>").hide(); // the table row is added to keep correct table striping
|
||||
if (checkSessionStorageExists()) {
|
||||
if (window.sessionStorage) {
|
||||
sessionStorage.setItem('show_advanced_preset', 0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -151,13 +151,13 @@ $pagetitle .= html_safe(sprintf(' | %s.%s', $config['system']['hostname'], $conf
|
||||
$('[id*="show_all_help"]').toggleClass("fa-toggle-on fa-toggle-off");
|
||||
$('[id*="show_all_help"]').toggleClass("text-success text-danger");
|
||||
if ($('[id*="show_all_help"]').hasClass("fa-toggle-on")) {
|
||||
if (checkSessionStorageExists()) {
|
||||
if (window.sessionStorage) {
|
||||
sessionStorage.setItem('all_help_preset', 1);
|
||||
}
|
||||
$('[for*="help_for"]').addClass("show");
|
||||
$('[for*="help_for"]').removeClass("hidden");
|
||||
} else {
|
||||
if (checkSessionStorageExists()) {
|
||||
if (window.sessionStorage) {
|
||||
sessionStorage.setItem('all_help_preset', 0);
|
||||
}
|
||||
$('[for*="help_for"]').addClass("hidden");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user