提交 2c3cbb27 编写于 作者: C Catouse

* fix icons section selector id.

上级 74b5314c
......@@ -436,7 +436,7 @@
};
var chooseIcon = function($icon){
var $search = $('#section-control-icons');
var $search = $('#section-control-icon');
if(!$icon || !$icon.length) {
$search.removeClass('section-preview-show').data('preview', null);
return;
......@@ -469,7 +469,7 @@
keys = [keys];
}
var $section = $('#section-control-icons');
var $section = $('#section-control-icon');
$body.attr('data-query', 'icons');
var $search = $section.children('.section-search');
if(!$search.length) {
......@@ -483,7 +483,7 @@
if(!$list.length) {
$list = $('<ul data-view="icons">');
$.each(data, function(iconName, icon){
var $li = $('<li id="control-icons-' + iconName + '" data-id="' + iconName + '"><a href="#control/icons/' + iconName + '"><i class="icon icon-' + iconName + '"></i> icon-' + iconName + '</a></li>');
var $li = $('<li id="control-icon-' + iconName + '" data-id="' + iconName + '"><a href="#control/icons/' + iconName + '"><i class="icon icon-' + iconName + '"></i> icon-' + iconName + '</a></li>');
icon.id = iconName;
$li.data('icon', icon);
$list.append($li);
......@@ -541,7 +541,7 @@
}
});
var $li = $('#control-icons-' + iconId).toggleClass('hide', !choosed);
var $li = $('#control-icon-' + iconId).toggleClass('hide', !choosed);
if(choosed && bestMatchWeight < weight) {
bestMatchWeight = weight;
$bestMatch = $li;
......@@ -653,7 +653,7 @@
weight = 100;
break;
case 'icon':
chooseThis = section.id === 'icons';
chooseThis = section.id === 'icon';
if(chooseThis) {
weight = 120;
matches.push({key: key, type: ['section', 'id']});
......@@ -1375,14 +1375,14 @@
$(this).closest('.card-heading').addClass('hover');
}).on('mouseleave', '.card-heading > h5 > .name, .card-heading > .icon', function(){
$(this).closest('.card-heading').removeClass('hover');
}).on('mouseenter', '#section-control-icons .section-search > ul > li > a', function(){
oldActivePreivewId = $('#section-control-icons').data('preview');
}).on('mouseenter', '#section-control-icon .section-search > ul > li > a', function(){
oldActivePreivewId = $('#section-control-icon').data('preview');
chooseIcon($(this).closest('li'));
}).on('mouseleave', '#section-control-icons .section-search > ul > li > a', function(){
}).on('mouseleave', '#section-control-icon .section-search > ul > li > a', function(){
if(oldActivePreivewId) {
chooseIcon($('#control-icons-' + oldActivePreivewId));
chooseIcon($('#control-icon-' + oldActivePreivewId));
}
}).on('click', '#section-control-icons .section-search > ul > li > a', function(){
}).on('click', '#section-control-icon .section-search > ul > li > a', function(){
oldActivePreivewId = $(this).closest('li').data('id');
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册