minor update
This commit is contained in:
1 parent
74b2bbf4b7
commit
4215ed5538
7 files changed
+180
-81
No files matched your search
@@ -8,32 +8,37 @@ var orbitDesktopAPI = function(){
|
||||
//msg (string) : message to display
|
||||
//type (string : success, imp, alert
|
||||
//time (int) : duration for notification in seconds
|
||||
var $notify = $("#orbitnote");
|
||||
var img, n_height;
|
||||
var $notify = $('#orbitnote'),
|
||||
ani_method = { direction: 'up',easing: 'easeInOutQuint' },
|
||||
img, n_height;
|
||||
if(!type)type="";
|
||||
switch(type){
|
||||
case "alert":
|
||||
img = "note_alert.png";
|
||||
img = "exclamation-sign";
|
||||
break;
|
||||
case "imp":
|
||||
img = "note_imp.png";
|
||||
img = "warning-sign";
|
||||
break;
|
||||
case "success":
|
||||
img = "note_success.png";
|
||||
img = "ok";
|
||||
break;
|
||||
default:
|
||||
img = "note_alert.png";
|
||||
img = "exclamation-sign";
|
||||
break;
|
||||
}
|
||||
$notify.find("img#note_img").attr("src",o.notifyImgPath+img);
|
||||
$notify.find(".note_message").html(msg);
|
||||
n_height = $notify.outerHeight();
|
||||
if(!time)time=5000; else time=time*1000;
|
||||
$notify
|
||||
.css({'top':-n_height, 'display':'block', 'opacity':0})
|
||||
.animate({top:0,opacity:1},200)
|
||||
if( !time || time > 20) time = 5000; else time = time*1000;
|
||||
|
||||
var sign = '<div class="note_type"><span class="sign icon-'+ img +'"></span></div>',
|
||||
message = '<div class="note_message">'+ msg +'</div>',
|
||||
item = '<div class="note_holder admbg">'+ sign + message +'</div>';
|
||||
|
||||
$(item)
|
||||
.prependTo($notify)
|
||||
.stop(1,1)
|
||||
.toggle('slide', ani_method, 300)
|
||||
.delay(time)
|
||||
.animate({top:-n_height,opacity:0},200);
|
||||
.toggle('slide', ani_method, 800);
|
||||
$notify.find('.note_holder:hidden').remove();
|
||||
};
|
||||
this.executeFunc = function(func,callbackFn){
|
||||
//takes 2 arguments
|
||||
|
||||
Reference in new issue
Block a user