Skip to content

Commit 6aafdac

Browse files
committed
added disable popup checkbox on options page
1 parent e891299 commit 6aafdac

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

source/options.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,18 @@ <h3>Profile Trigger Value</h3>
6060
<input type="text" id="profiletrigger" value="">
6161
<button class="save-button">Save</button>
6262
</p>
63+
64+
<h3>Disable Popup</h3>
65+
<p class="note">
66+
If checked, xdebug session will be enabled / disabled by left click on the
67+
xdebug helper icon, xdebug helper's popup will be disabled.
68+
</p>
69+
<p>
70+
<input type="checkbox" id="disable-popup" value="1">
71+
<span>Disable Popup</span>
72+
<button class="save-button">Save</button>
73+
</p>
74+
6375
<footer id="footer">
6476
<a href="https://github.com/mac-cain13/xdebug-helper-for-chrome" class="contribute" target="_blank">
6577
Feel free to submit ideas, bugs and pull request to our <span>Github project</span>

source/options.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ function save_options()
33
localStorage["xdebugIdeKey"] = document.getElementById("idekey").value;
44
localStorage["xdebugTraceTrigger"] = document.getElementById("tracetrigger").value;
55
localStorage["xdebugProfileTrigger"] = document.getElementById("profiletrigger").value;
6+
localStorage.xdebugDisablePopup = document.getElementById('disable-popup').checked ? '1' : '0';
67
}
78

89
function restore_options()
@@ -42,6 +43,9 @@ function restore_options()
4243
} else {
4344
$("#profiletrigger").val(null);
4445
}
46+
47+
// Restore Disable Popup
48+
document.getElementById('disable-popup').checked = (localStorage.xdebugDisablePopup === '1') ? true : false;
4549
}
4650

4751
$(function()
@@ -63,6 +67,9 @@ $(function()
6367

6468
$("#idekey").change(save_options);
6569

70+
// Save Disable Popup on change event
71+
$('#disable-popup').change(save_options);
72+
6673
$('.save-button').click(save_options);
6774

6875
restore_options();

0 commit comments

Comments
 (0)