|
|
@@ -54,58 +54,65 @@ BxDolReport.prototype.report = function(oLink) {
|
|
|
|
|
|
BxDolReport.prototype.onReport = function(oData, oElement)
|
|
|
{
|
|
|
- if(oData && oData.msg != undefined)
|
|
|
- alert(oData.msg);
|
|
|
+ var $this = this;
|
|
|
+ var fContinue = function() {
|
|
|
+ if(oData && oData.code != 0)
|
|
|
+ return;
|
|
|
|
|
|
- if(oData && oData.code != 0)
|
|
|
- return;
|
|
|
+ if(oData && oData.label_icon)
|
|
|
+ $(oElement).find('.sys-icon').attr('class', 'sys-icon ' + oData.label_icon);
|
|
|
|
|
|
- if(oData && oData.label_icon)
|
|
|
- $(oElement).find('.sys-icon').attr('class', 'sys-icon ' + oData.label_icon);
|
|
|
+ if(oData && oData.label_title) {
|
|
|
+ $(oElement).attr('title', oData.label_title);
|
|
|
+ $(oElement).find('span').html(oData.label_title);
|
|
|
+ }
|
|
|
|
|
|
- if(oData && oData.label_title) {
|
|
|
- $(oElement).attr('title', oData.label_title);
|
|
|
- $(oElement).find('span').html(oData.label_title);
|
|
|
- }
|
|
|
+ if(oData && oData.disabled)
|
|
|
+ $(oElement).removeAttr('onclick').addClass($(oElement).hasClass('bx-btn') ? 'bx-btn-disabled' : 'bx-report-disabled');
|
|
|
|
|
|
- if(oData && oData.disabled)
|
|
|
- $(oElement).removeAttr('onclick').addClass($(oElement).hasClass('bx-btn') ? 'bx-btn-disabled' : 'bx-report-disabled');
|
|
|
+ var oCounter = $this._getCounter(oElement);
|
|
|
+ if(oCounter && oCounter.length > 0) {
|
|
|
+ oCounter.html(oData.countf);
|
|
|
|
|
|
- var oCounter = this._getCounter(oElement);
|
|
|
- if(oCounter && oCounter.length > 0) {
|
|
|
- oCounter.html(oData.countf);
|
|
|
+ oCounter.parents('.' + $this._sSP + '-counter-holder:first').bx_anim(oData.count > 0 ? 'show' : 'hide');
|
|
|
+ }
|
|
|
+ };
|
|
|
|
|
|
- oCounter.parents('.' + this._sSP + '-counter-holder:first').bx_anim(oData.count > 0 ? 'show' : 'hide');
|
|
|
- }
|
|
|
+ if(oData && oData.msg != undefined)
|
|
|
+ bx_alert(oData.msg, fContinue);
|
|
|
+ else
|
|
|
+ fContinue();
|
|
|
};
|
|
|
|
|
|
BxDolReport.prototype.processJson = function(oData, oElement) {
|
|
|
oElement = oElement != undefined ? oElement : this._oParent;
|
|
|
|
|
|
+ var fContinue = function() {
|
|
|
+ //--- Show Popup
|
|
|
+ if(oData && oData.popup != undefined) {
|
|
|
+ $('#' + oData.popup_id).remove();
|
|
|
+
|
|
|
+ $(oData.popup).hide().prependTo('body').dolPopup({
|
|
|
+ pointer: {
|
|
|
+ el: oElement
|
|
|
+ },
|
|
|
+ fog: {
|
|
|
+ color: '#fff',
|
|
|
+ opacity: .7
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ //--- Evaluate JS code
|
|
|
+ if (oData && oData.eval != undefined)
|
|
|
+ eval(oData.eval);
|
|
|
+ };
|
|
|
+
|
|
|
//--- Show Message
|
|
|
- if(oData && oData.msg != undefined)
|
|
|
- alert(oData.msg);
|
|
|
if(oData && oData.message != undefined)
|
|
|
- alert(oData.message);
|
|
|
-
|
|
|
- //--- Show Popup
|
|
|
- if(oData && oData.popup != undefined) {
|
|
|
- $('#' + oData.popup_id).remove();
|
|
|
-
|
|
|
- $(oData.popup).hide().prependTo('body').dolPopup({
|
|
|
- pointer: {
|
|
|
- el: oElement
|
|
|
- },
|
|
|
- fog: {
|
|
|
- color: '#fff',
|
|
|
- opacity: .7
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
- //--- Evaluate JS code
|
|
|
- if (oData && oData.eval != undefined)
|
|
|
- eval(oData.eval);
|
|
|
+ bx_alert(oData.message, fContinue);
|
|
|
+ else
|
|
|
+ fContinue();
|
|
|
};
|
|
|
|
|
|
BxDolReport.prototype._getButtons = function(oElement) {
|