[dw-free] Revamp /update
[commit: http://hg.dwscoalition.org/dw-free/rev/87730fdeb65e]
http://bugs.dwscoalition.org/show_bug.cgi?id=2524
Remove failed copy-pasta code from iconselector. This makes absolutely no
sense to have here.
Patch by
fu.
Files modified:
http://bugs.dwscoalition.org/show_bug.cgi?id=2524
Remove failed copy-pasta code from iconselector. This makes absolutely no
sense to have here.
Patch by
![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
Files modified:
- htdocs/js/jquery.tagselector.js
-------------------------------------------------------------------------------- diff -r e60dcfa2823e -r 87730fdeb65e htdocs/js/jquery.tagselector.js --- a/htdocs/js/jquery.tagselector.js Thu Dec 22 18:02:33 2011 +0800 +++ b/htdocs/js/jquery.tagselector.js Thu Dec 22 18:04:11 2011 +0800 @@ -58,54 +58,12 @@ $("#taglist").trigger("autocomplete_inittext", tags); } - function _selectContainer($container, keyword, replaceKwMenu) { - $("#"+$.fn.tagselector.selected).removeClass(opts.selectedClass); - if ( $container.length == 0 ) return; - - $.fn.iconselector.selected = $container.attr("id"); - $container.addClass(opts.selectedClass); - $container.show(); - - if ( keyword != null ) { - // select by keyword - $.fn.iconselector.selectedKeyword = keyword; - } else { - // select by picid (first keyword) - $.fn.iconselector.selectedKeyword = $container.data("defaultkw"); - } - - if ( replaceKwMenu ) { - var $keywords = $container.find(".keywords"); - $(".iconselector_top .keywords", $.fn.iconselector.instance) - .replaceWith($keywords.clone()); - if ($keywords.length > 0) - $("#iconselector_select").removeAttr("disabled"); - else - $("#iconselector_select").attr("disabled", "disabled"); - } else { - $(".iconselector_top .selected", $.fn.iconselector.instance) - .removeClass("selected"); - } - - // can't rely on a cached value, because it may have been replaced - $(".iconselector_top .keywords", $.fn.iconselector.instance) - .find("a.keyword") - .filter(function() { - return $(this).text() == $.fn.iconselector.selectedKeyword; - }) - .addClass("selected"); - } - function _filter(event) { var val = $("#tagselector_search").val().toLocaleLowerCase(); $("#tagselector_tags_list li").hide().each(function(i, item) { if ( $(this).text().indexOf(val) != -1 ) $(this).show(); }); - - var $visible = $("#tagselector_tags_list li:visible"); - if ( $visible.length == 1 ) - _selectContainer($visible); }; function _dialogHTML() { --------------------------------------------------------------------------------