mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-01 15:09:14 +00:00
tmp mod
This commit is contained in:
@@ -27,3 +27,45 @@ require.config({
|
||||
text: 'lib/text'
|
||||
}
|
||||
});
|
||||
|
||||
define([
|
||||
'jquery',
|
||||
'underscore'
|
||||
], function($, _) {
|
||||
return {
|
||||
INFO_TIMEOUT: 10000, // 10 secs for info msg
|
||||
SUCCESS_TIMEOUT: 3000, // 3 secs for success msg
|
||||
ERROR_TIMEOUT: 3000, // 3 secs for error msg
|
||||
|
||||
showConfirm: function(title, content, yesCallback) {
|
||||
var $popup = $("#confirm-popup");
|
||||
var $cont = $('#confirm-con');
|
||||
var $container = $('#simplemodal-container');
|
||||
var $yesBtn = $('#confirm-yes');
|
||||
|
||||
$cont.html('<h3>' + title + '</h3><p>' + content + '</p>');
|
||||
$popup.modal({appendTo: '#main'});
|
||||
$container.css({'height':'auto'});
|
||||
|
||||
$yesBtn.click(yesCallback);
|
||||
},
|
||||
|
||||
closeModal: function() {
|
||||
$.modal.close();
|
||||
},
|
||||
|
||||
feedback: function(con, type, time) {
|
||||
var time = time || 5000;
|
||||
if ($('.messages')[0]) {
|
||||
$('.messages').html('<li class="' + type + '">' + con + '</li>');
|
||||
} else {
|
||||
var html = '<ul class="messages"><li class="' + type + '">' + con + '</li></ul>';
|
||||
$('#main').append(html);
|
||||
}
|
||||
$('.messages').css({'left':($(window).width() - $('.messages').width())/2, 'top':10}).removeClass('hide');
|
||||
setTimeout(function() { $('.messages').addClass('hide'); }, time);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user