增加移动端判断,如果是移动端取消tip设置

This commit is contained in:
Argo-Lenovo 2016-11-27 22:01:27 +08:00
parent b24b3b3a06
commit cc0ca65fab
3 changed files with 11 additions and 6 deletions

View File

@ -148,7 +148,7 @@
highlight: function (element, errorClass, validClass) {
var $ele = $(element);
$ele.parents('.form-group').addClass(errorClass).removeClass(validClass);
if ($.isFunction($ele.tipso)) $ele.tipso({
if (!$.browser.versions.mobile && $.isFunction($ele.tipso)) $ele.tipso({
useTitle: false,
position: 'top',
background: '#a94442'
@ -161,7 +161,7 @@
},
errorPlacement: function (label, element) {
var $ele = $(element);
if ($.isFunction($ele.tipso)) $ele.tipso('update', 'content', $(label).text());
if (!$.browser.versions.mobile && $.isFunction($ele.tipso)) $ele.tipso('update', 'content', $(label).text());
}
});
if (handler && $.isArray(handler.button)) {

View File

@ -15,7 +15,8 @@
$('#main-content, .content-body, body').animate({
scrollTop: 0
}, 200);
}).tipso({ position: 'left', background: '#333', width: 70 });
});
if (!$.browser.versions.mobile) $("#gotoTop").tipso({ position: 'left', background: '#333', width: 70 });
// breadcrumb
var arch = $('#nav-accordion').find('a.active').last();

View File

@ -90,7 +90,7 @@
if (result && options.key == '') {
result = $.parseJSON(result);
if ($.isArray(result)) {
var html = '<li class="{4}"><i class="fa fa-ellipsis-v"></i><div class="task-title"><span class="task-title-sp" title="{1}">{2}</span><span class="badge badge-sm label-success">{0}</span><span class="task-value" title="{3}">{3}</span><div class="pull-right hidden-phone"><button class="btn btn-danger btn-xs fa fa-trash-o" title="{1}" data-key="{1}" data-url="{5}"></button></div></div></li>';
var html = '<li class="{4}"><i class="fa fa-ellipsis-v"></i><div class="task-title"><span class="task-title-sp" title="{1}">{2}</span><span class="badge badge-sm label-success">{0}</span><span class="task-value" title="{3}">{3}</span><div class="pull-right hidden-phone"><button class="btn btn-danger btn-xs fa fa-trash-o tipso_style" title="{1}" data-key="{1}" data-url="{5}"></button></div></div></li>';
var content = result.sort(function (x, y) {
return x.Key > y.Key ? 1 : -1;
}).map(function (ele) {
@ -134,13 +134,17 @@
}).join('');
$sortable.append($.format('<li class="title">{0}-{1}</li>', options.item.Desc, options.item.Key));
$sortable.append(content);
if (!$.browser.versions.mobile) $sortable.find('.tipso_style').tipso({ position: 'left', width: 400 });
}
}
}
});
}
$('#refreshCache').tipso({ position: 'left', width: 70 }).click(function () { listCacheUrl(); }).trigger('click');
$('#clearCache').tipso({ position: 'left', width: 70 }).click(function () { listCacheUrl({ clear: true }); });
$('#refreshCache').click(function () { listCacheUrl(); }).trigger('click');
$('#clearCache').click(function () { listCacheUrl({ clear: true }); });
if (!$.browser.versions.mobile) {
$('#refreshCache, #clearCache').tipso({ width: 70, position: 'left' });
}
$sortable.on('click', '.btn', function () {
console.log($(this).attr('data-key'));
listCache({ key: $(this).attr('data-key'), url: $(this).attr('data-url') });