Skip to content

Commit

Permalink
V2.9.1
Browse files Browse the repository at this point in the history
  • Loading branch information
gjb2048 committed Mar 3, 2016
1 parent f61cd57 commit 63f62b4
Showing 1 changed file with 31 additions and 31 deletions.
62 changes: 31 additions & 31 deletions amd/src/block_theme_selector.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,40 +28,40 @@
/* jshint ignore:start */
define(['jquery', 'core/log'], function($, log) {

"use strict"; // jshint ;_;
"use strict"; // jshint ;_;

log.debug('Block Theme Selector jQuery AMD');
log.debug('Block Theme Selector jQuery AMD');

return {
init: function(data) {
log.debug('Block Theme Selector AMD init initialised');
return {
init: function(data) {
log.debug('Block Theme Selector AMD init initialised');

$(document).ready(function() {
$('.block_theme_selector select').on('change', function(e) {
var $select = $(e.target);
var choose = $select.find(':selected').val();
var urlswitch = $select.data('urlswitch');
if (urlswitch == 2) {
var changeparam;
var urlparams = $select.data('urlparams');
if (urlparams == 1) {
changeparam = '?';
} else {
changeparam = '&';
}
changeparam += 'theme=' + choose;
window.location = $select.data('url') + changeparam;
} else {
var params = {
'sesskey': $select.data('sesskey'),
'device': $select.data('device'),
'choose': choose
};
window.location = '/theme/index.php?' + $.param(params);
}
});
});
$(document).ready(function() {
$('.block_theme_selector select').on('change', function(e) {
var $select = $(e.target);
var choose = $select.find(':selected').val();
var urlswitch = $select.data('urlswitch');
if (urlswitch == 2) {
var changeparam;
var urlparams = $select.data('urlparams');
if (urlparams == 1) {
changeparam = '?';
} else {
changeparam = '&';
}
changeparam += 'theme=' + choose;
window.location = $select.data('url') + changeparam;
} else {
var params = {
'sesskey': $select.data('sesskey'),
'device': $select.data('device'),
'choose': choose
};
window.location = '/theme/index.php?' + $.param(params);
}
});
});
}
}
}
});
/* jshint ignore:end */

0 comments on commit 63f62b4

Please sign in to comment.