Don't save zoom mode cookie upon window resize
This commit is contained in:
parent
84dbc3abff
commit
35d2f8682c
@ -1,5 +1,7 @@
|
||||
$(function() {
|
||||
function zoom(zoom_type) {
|
||||
function zoom(zoom_type, save_cookie) {
|
||||
save_cookie = save_cookie === undefined ? true : save_cookie;
|
||||
|
||||
var img = $('.shm-main-image');
|
||||
|
||||
if(zoom_type == "full") {
|
||||
@ -21,7 +23,9 @@ $(function() {
|
||||
|
||||
$(".shm-zoomer").val(zoom_type);
|
||||
|
||||
Cookies.set("ui-image-zoom", zoom_type, {expires: 365});
|
||||
if (save_cookie) {
|
||||
Cookies.set("ui-image-zoom", zoom_type, {expires: 365});
|
||||
}
|
||||
}
|
||||
|
||||
$(".shm-zoomer").change(function(e) {
|
||||
@ -29,7 +33,7 @@ $(function() {
|
||||
});
|
||||
$(window).resize(function(e) {
|
||||
$(".shm-zoomer").each(function (e) {
|
||||
zoom(this.options[this.selectedIndex].value)
|
||||
zoom(this.options[this.selectedIndex].value, false)
|
||||
});
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user