unified feedback v1
This commit is contained in:
35
jquery/databap.js
vendored
35
jquery/databap.js
vendored
@@ -339,7 +339,7 @@ function Databap()
|
||||
{
|
||||
//Add page Header
|
||||
self.$title
|
||||
.find('.h1_wrap').attr('id', self.vars.current_page+'_title')
|
||||
.find('.side_margins').attr('id', self.vars.current_page+'_title')
|
||||
.find('#title_text').text(self.vars.page_titles[self.vars.current_page]);
|
||||
self.$title.fadeTo(self.consts.transTime, 1);
|
||||
self.vars.pageIcon = 'fa-c-'+self.vars.current_page;
|
||||
@@ -360,11 +360,11 @@ function Databap()
|
||||
|
||||
this.pageIcon = function(pageIcon, comment)
|
||||
{
|
||||
var $Header = $('#'+self.vars.current_page+'_title');
|
||||
$Header.find('i')
|
||||
.attr('class', 'fa fa-fw fa-20')
|
||||
.addClass(pageIcon);
|
||||
$Header.find('h1').attr('title', comment || '');
|
||||
self.$title
|
||||
.find('h1').attr('title', comment || '')
|
||||
.find('#page_icon')
|
||||
.attr('class', 'fa fa-fw fa-20')
|
||||
.addClass(pageIcon);
|
||||
};
|
||||
|
||||
this.addBufferIcon = function()
|
||||
@@ -432,7 +432,8 @@ function Databap()
|
||||
this.saveForm = function(action, $form, fOnSuccess, bProcessIcon, dataType)
|
||||
{
|
||||
var sFormVars = $form.serialize();
|
||||
if(typeof bProcessIcon != 'undefined') self.addBufferIcon();
|
||||
bProcessIcon = bProcessIcon || false;
|
||||
if(bProcessIcon) self.addBufferIcon();
|
||||
if(!dataType) dataType = 'text';
|
||||
|
||||
self.vars.loading = true;
|
||||
@@ -446,7 +447,7 @@ function Databap()
|
||||
{
|
||||
self.vars.loading = false;
|
||||
self.vars.disconnected = false;
|
||||
if(typeof bProcessIcon != 'undefined') self.resetIcon();
|
||||
if(bProcessIcon) self.resetIcon();
|
||||
fOnSuccess(result);
|
||||
},
|
||||
error: function(jqXHR, textStatus, errorThrown)
|
||||
@@ -465,7 +466,8 @@ function Databap()
|
||||
{
|
||||
if(!vars) vars = {};
|
||||
if(!type) type = 'html';
|
||||
if(typeof bProcessIcon != 'undefined') self.addBufferIcon();
|
||||
bProcessIcon = bProcessIcon || false;
|
||||
if(bProcessIcon) self.addBufferIcon();
|
||||
|
||||
vars['a'] = action;
|
||||
self.vars.loading = true;
|
||||
@@ -482,7 +484,7 @@ function Databap()
|
||||
{
|
||||
self.vars.loading = false;
|
||||
self.vars.disconnected = false;
|
||||
if(typeof bProcessIcon != 'undefined') self.resetIcon();
|
||||
if(bProcessIcon) self.resetIcon();
|
||||
fOnSuccess(result);
|
||||
}
|
||||
},
|
||||
@@ -493,7 +495,7 @@ function Databap()
|
||||
self.vars.loading = false;
|
||||
self.vars.disconnected = true;
|
||||
debug('Error databap.js 361');
|
||||
if(typeof bProcessIcon != 'undefined') self.resetIcon();
|
||||
if(bProcessIcon) self.resetIcon();
|
||||
if(!fOnError)
|
||||
{
|
||||
self.showError(textStatus);
|
||||
@@ -846,6 +848,17 @@ function Databap()
|
||||
$msg.hide().insertBefore(elem).slideDown('fast', function(){databap.updateScrollBar('bottom');}).delay(5000).slideUp('fast', function(){$(this).remove();databap.updateScrollBar();});
|
||||
};
|
||||
|
||||
this.feedback = function(sClass, sMsg)
|
||||
{
|
||||
$('<span>', {'class':'feedback '+sClass})
|
||||
.append($('<i>', {'class':'fa fa-inline'}))
|
||||
.append(self.addPunctuation(sMsg))
|
||||
.appendTo('#title_feedback')
|
||||
.slideDown('fast')
|
||||
.delay(5000)
|
||||
.slideUp('fast', function(){$(this).remove();});
|
||||
};
|
||||
|
||||
this.setTitle = function(extra)
|
||||
{
|
||||
if(!extra)
|
||||
|
||||
Reference in New Issue
Block a user