version elkarte: 1.0.6
(function($){
$(document).ready(function(){
$('.myform select').on("click", function(e){
// ... my code
}
});
})(jQuery);
I edited the message to remove the spoiler tags. One click less to see the errors. :P
I'm not sure what the code is, I guess some code you are using, but the error seems related to Superclick:
https://github.com/elkarte/Elkarte/blob/master/themes/default/scripts/elk_jquery_plugins.js#L574
I suppose we can see if there is a more recent version of SC available?
@Spuds do you know from where did we grab the one we are shipping?
I think that is the latest version (1.0.0), there has not been an update that I know of. It in the Joels github space along with superfish.
I'm not sure why superclick is being called. It would appear that it is being bound to .myform, select from somewhat but is not initiated properly.
@inter do you know if you are using .superclick (click to open menus) and if so was the line in theme.js altered at all?
my full code
html
function elga_show_select_cats()
{
global $context, $scripturl, $user_info;
echo '
<div class="elga-select-cats">
<form name="elga-cats">
<select>
<option value="0">Выберите альбом для перехода</option>
</select>
</form>
</div>';
}
mymod.js
(function($){
$(document).ready(function(){
var $select = $('div.elga-select-cats form[name="elga-cats"] select');
$select.on("click", function(){
if (this.length === 1 && ( ! arguments.callee.loadCats ) ) {
var $first = $select.find(":selected"),
selecttext = $first.text();
$first.text('Loading');
arguments.callee.loadCats = 1;
$.getJSON(elk_scripturl + "?action=gallery;sa=ajax;m=loadcats", function(data) {
data.result.forEach(function(val){
$select.append( $('<option value="' + val.id + '">' + val.name + '</option>') );
});
})
// .done( () => { console.log( "second success" ); } );
// .fail( () => { console.log( "error" ); } );
.always(function() {
$first.text(selecttext);
});
}
});
$select.on("change", function(){
var selval = $select.val();
if (selval > 0) {
window.location = elk_scripturl + '?action=gallery;sa=album;id=' + selval;
}
});
});
})(jQuery);
Why are you putting code in spoiler tags? We're used to big messages with lots of code. We even like it ;)
Big height my message. I like spoiler tag :D
solved:
I have been on top of the button with the class:
<ul class="sf-js-enabled sf-arrows">
<li class="listlevel1">
i replace:
<ul>
<li class="listlevel1">