for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
$('i.glyphicon-refresh-animate').hide();
function updateItems(r) {
_opts.items.avaliable = r.avaliable;
_opts
/** global: _opts */
This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.
To learn more about declaring variables in Javascript, see the MDN.
_opts.items.assigned = r.assigned;
search('avaliable');
search('assigned');
}
$('.btn-assign').click(function () {
var $this = $(this);
var target = $this.data('target');
var items = $('select.list[data-target="' + target + '"]').val();
if (items.length) {
$this.children('i.glyphicon-refresh-animate').show();
$.post($this.attr('href'), {items: items}, function (r) {
updateItems(r);
}).always(function () {
$this.children('i.glyphicon-refresh-animate').hide();
});
return false;
$('.search[data-target]').keyup(function () {
search($(this).data('target'));
function search(target) {
var $list = $('select.list[data-target="' + target + '"]');
$list.html('');
var q = $('.search[data-target="' + target + '"]').val();
var groups = {
role: [$('<optgroup label="<?=Yii::t('yuncms','Roles')?>">'), false],
Roles
/** global: Roles */
yuncms
/** global: yuncms */
permission: [$('<optgroup label="<?=Yii::t('yuncms','Permission')?>">'), false],
Permission
/** global: Permission */
};
$.each(_opts.items[target], function (name, group) {
if (name.indexOf(q) >= 0) {
$('<option>').text(name).val(name).appendTo(groups[group][0]);
groups[group][1] = true;
$.each(groups, function () {
if (this[1]) {
$list.append(this[0]);
// initial
This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.
To learn more about declaring variables in Javascript, see the MDN.