mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-08 21:06:24 +08:00
Fix jQuery selector, make it work for new samples
This commit is contained in:
parent
e52277bdad
commit
af6bf2aee1
1 changed files with 6 additions and 4 deletions
|
@ -225,7 +225,7 @@ function initPageTutorialSteps(pageFirstStepN, pageLastStepN, nextPagePath,
|
||||||
* @return {Object} This
|
* @return {Object} This
|
||||||
*/
|
*/
|
||||||
$.fn.makeDropdownOptionsLinks = function(selectedIdx, urlParam) {
|
$.fn.makeDropdownOptionsLinks = function(selectedIdx, urlParam) {
|
||||||
selectedIdx = _.isUndefined(selectedIdx) ? 1 : selectedIdx;
|
selectedIdx = _.isUndefined(selectedIdx) ? -1 : selectedIdx;
|
||||||
|
|
||||||
$(this).change(function() {
|
$(this).change(function() {
|
||||||
window.location.href = addParam($(this).find('option:selected')
|
window.location.href = addParam($(this).find('option:selected')
|
||||||
|
@ -240,9 +240,11 @@ $.fn.makeDropdownOptionsLinks = function(selectedIdx, urlParam) {
|
||||||
$(this).attr('href', '#');
|
$(this).attr('href', '#');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$(this)
|
var selectedOpt = $(this).find('option[value="' + selectedIdx + '"]');
|
||||||
.find('option[value=' + selectedIdx + ']')
|
if (!selectedOpt.length) {
|
||||||
.attr('selected', true);
|
selectedOpt = $(this).find('option').eq(1);
|
||||||
|
}
|
||||||
|
selectedOpt.attr('selected', true);
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue