bug fix on admin_init and code cleanup
This commit is contained in:
parent
bf32f439e6
commit
d1275eb680
5 changed files with 592 additions and 538 deletions
|
|
@ -1,37 +1,26 @@
|
|||
jQuery(document).ready(function($) {
|
||||
jQuery(document).ready(function ($) {
|
||||
|
||||
// $('#show-tokens').on('click', function() {
|
||||
// if ($('input.token').attr('type') == 'password') {
|
||||
// $('input.token').attr('type', 'text');
|
||||
// $(this).addClass('dashicons-hidden').removeClass('dashicons-visibility')
|
||||
// } else {
|
||||
// $('input.token').attr('type', 'password');
|
||||
// $(this).addClass('dashicons-visibility').removeClass('dashicons-hidden')
|
||||
// }
|
||||
// return false;
|
||||
// });
|
||||
$('input.token').each(function () {
|
||||
var token = $(this);
|
||||
var toggle = $('<a href="#" class="token-toggle dashicons dashicons-visibility"></a>');
|
||||
token.wrap('<span class="token-box"></span>').after(toggle);
|
||||
toggle.on('click', function () {
|
||||
if (token.attr('type') === 'password') {
|
||||
token.attr('type', 'text');
|
||||
toggle.addClass('dashicons-hidden').removeClass('dashicons-visibility');
|
||||
} else {
|
||||
token.attr('type', 'password');
|
||||
toggle.addClass('dashicons-visibility').removeClass('dashicons-hidden');
|
||||
}
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
$('input.token').each(function() {
|
||||
var token = $(this)
|
||||
var toggle = $('<a href="#" class="token-toggle dashicons dashicons-visibility"></a>');
|
||||
token.wrap('<span class="token-box"></span>').after(toggle);
|
||||
toggle.on('click', function() {
|
||||
if (token.attr('type') == 'password') {
|
||||
token.attr('type', 'text')
|
||||
toggle.addClass('dashicons-hidden').removeClass('dashicons-visibility')
|
||||
} else {
|
||||
token.attr('type', 'password')
|
||||
toggle.addClass('dashicons-visibility').removeClass('dashicons-hidden')
|
||||
}
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
$('.repo-toggle').on('click', function() {
|
||||
var id = $(this).data('repo');
|
||||
$('.repo-'+id).toggleClass('open')
|
||||
$('.repo-'+id+' > ul.packages').slideToggle(400)
|
||||
return false;
|
||||
});
|
||||
$('.repo-toggle').on('click', function () {
|
||||
var id = $(this).data('repo');
|
||||
$('.repo-' + id).toggleClass('open');
|
||||
$('.repo-' + id + ' > ul.packages').slideToggle(400);
|
||||
return false;
|
||||
});
|
||||
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue