summaryrefslogtreecommitdiffstats
path: root/src/usr/local/www/jquery
diff options
context:
space:
mode:
authorStephen Beaver <sbeaver@netgate.com>2016-01-12 08:56:58 -0500
committerStephen Beaver <sbeaver@netgate.com>2016-01-12 08:58:03 -0500
commitc95dabdd19faa6c1221638861306cd387fb1958f (patch)
treeaf491d6ea1dec03ee4bec548ac925b525e33a8d3 /src/usr/local/www/jquery
parenta0b96d300eb29e50e5a92666650b21fd150c0d1e (diff)
downloadpfsense-c95dabdd19faa6c1221638861306cd387fb1958f.zip
pfsense-c95dabdd19faa6c1221638861306cd387fb1958f.tar.gz
Improved infoblock system no longer needs sufficies if more than one per page
Removed long commented out script
Diffstat (limited to 'src/usr/local/www/jquery')
-rw-r--r--src/usr/local/www/jquery/pfSenseHelpers.js20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/usr/local/www/jquery/pfSenseHelpers.js b/src/usr/local/www/jquery/pfSenseHelpers.js
index f447b65..ebf00e0 100644
--- a/src/usr/local/www/jquery/pfSenseHelpers.js
+++ b/src/usr/local/www/jquery/pfSenseHelpers.js
@@ -387,25 +387,29 @@ $('[id^=delete]').click(function(event) {
// "More information" handlers --------------------------------------------------------------------
// If there is an infoblock, automatically add an info icon that toggles its display
-// If there is n=more than one infoblock on a page, each must use a unique class suffic. e.g.: infoblock_01 or infoblock_open_19
-$('[class^="infoblock"], [class^="infoblock_open"]').each(function() {
- var classname = $(this).attr("class");
- var sfx = classname.substr(9);
+var sfx = 0;
- if (classname.indexOf("infoblock_open") == -1) {
+$('.infoblock').each(function() {
+ // If the block has hte class "blockopen" it is initiall open
+ if (! $(this).hasClass("blockopen")) {
$(this).hide();
+ } else {
+ $(this).removeClass("blockopen");
}
- $(this).before('<i class="fa fa-info-circle icon-pointer" style="color: #337AB7; font-size:20px; margin-left: 10px; margin-bottom: 10px;" id="showinfo' + sfx + '" title="More information"></i>');
+ // Add the "i" icon before the infoblock, incrementing hte icon id for each block (in case there are multiple infoblocks on a page)
+ $(this).before('<i class="fa fa-info-circle icon-pointer" style="color: #337AB7; font-size:20px; margin-left: 10px; margin-bottom: 10px;" id="showinfo' + sfx.toString() + '" title="More information"></i>');
+ $(this).removeClass("infoblock");
+ $(this).addClass("infoblock" + sfx.toString());
+ sfx++;
});
// Show the help on clicking the info icon
$('[id^="showinfo"]').click(function() {
var id = $(this).attr("id");
- var target = "infoblock" + id.substr(8);
- $('.' + target).toggle();
+ $('.' + "infoblock" + id.substr(8)).toggle();
});
// ------------------------------------------------------------------------------------------------
OpenPOWER on IntegriCloud