-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdm_js.js
More file actions
51 lines (37 loc) · 1.21 KB
/
dm_js.js
File metadata and controls
51 lines (37 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*globals $*/
/*jslint eqeq:true plusplus:true*/
var oApp = window.oApp || {};
(function () {
'use strict';
$('#optionFilter').blur(function () {
var el = $(this),
oldVal = el.data('original'),
newVal = el.val(),
currentUrl = window.location.href,
newUrl = window.location.href.split('filter=' + oldVal).join('filter=' + newVal);
if (newVal !== oldVal) {
if (currentUrl === newUrl) {
newUrl = window.location.href + '&filter=' + newVal;
}
window.location.href = newUrl;
}
});
$('#optionShowHash').change(function () {
var el = $(this),
isChecked = el.prop('checked'),
newUrl = window.location.href.split('&showhash').join('');
if (isChecked) {
newUrl += '&showhash';
}
window.location.href = newUrl;
});
$('#optionShowDate').change(function () {
var el = $(this),
isChecked = el.prop('checked'),
newUrl = window.location.href.split('&showdate').join('');
if (isChecked) {
newUrl += '&showdate';
}
window.location.href = newUrl;
});
}());