Skip to content

Commit

Permalink
Add saveCollapsedDiffs option in options.html and options.js
Browse files Browse the repository at this point in the history
  • Loading branch information
tmosmant committed Dec 20, 2015
1 parent 6085d36 commit f86a7a2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
11 changes: 8 additions & 3 deletions options.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,21 @@
<div class="panel">
<div class="panel-body">
<form id="options-form">
<h1>Options</h1>
<h1 class="page-header">Options</h1>
<div class="form-group">
<label for="url">
Github Enterprise URL
</label>
<input id="url" type="url" class="form-control">
</div>
<div class="form-group">
<div class="checkbox">
<label>
<input id="saveCollapsedDiffs" type="checkbox">Save collapsed diffs
</label>
</div>
<div class="checkbox">
<label>
Allow backtick to switch tabs on pull requests? <input id="tabSwitchingEnabled" type="checkbox">
<input id="tabSwitchingEnabled" type="checkbox">Allow backtick to switch tabs on pull requests
</label>
</div>
<button class="btn btn-primary" id="save">Save</button>
Expand Down
5 changes: 4 additions & 1 deletion options.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
$(document).ready(function () {
loadItemsFromChromeStorage({
url: '',
saveCollapsedDiffs: true,
tabSwitchingEnabled: false
// Add new items here to get them loaded and their values put in the form.
}, setFormValues);
Expand All @@ -45,11 +46,13 @@

var $form = $(e.currentTarget);
var url = $form.find('#url').val();
var saveCollapsedDiffs = $form.find('#saveCollapsedDiffs').prop('checked');
var tabSwitchingEnabled = $form.find('#tabSwitchingEnabled').prop('checked');

saveOptionsToChromeStorage({
'url': url,
'tabSwitchingEnabled': tabSwitchingEnabled,
'saveCollapsedDiffs': saveCollapsedDiffs,
'tabSwitchingEnabled': tabSwitchingEnabled
}, function () {
var status = $('#status');
status.text('Options saved.');
Expand Down

0 comments on commit f86a7a2

Please sign in to comment.