diff --git a/src/base/pane.js b/src/base/pane.js index 9f36eff2a..ac78a8ba4 100644 --- a/src/base/pane.js +++ b/src/base/pane.js @@ -50,30 +50,46 @@ BI.Pane = BI.inherit(BI.Widget, { loading: function () { var self = this, o = this.options; + var loadingAnimation = BI.createWidget({ + type: "bi.horizontal", + cls: "bi-loading-widget" + ((BI.isIE() && BI.getIEVersion() < 10) ? " hack" : ""), + height: 60, + width: 60, + hgap: 10, + vgap: 5, + items: [{ + type: "bi.layout", + cls: "rect1", + height: 50, + width: 5 + }, { + type: "bi.layout", + cls: "rect2", + height: 50, + width: 5 + }, { + type: "bi.layout", + cls: "rect3", + height: 50, + width: 5 + }] + }); if (o.overlap === true) { if (!BI.Layers.has(this.getName())) { BI.createWidget({ - type: "bi.vtape", + type: "bi.absolute_center_adapt", items: [{ - el: { - type: "bi.layout", - cls: "loading-background" - }, - height: 30 + el: loadingAnimation }], element: BI.Layers.make(this.getName(), this) }); } BI.Layers.show(self.getName()); } else if (BI.isNull(this._loading)) { - this._loading = BI.createWidget({ - type: "bi.layout", - cls: "loading-background", - height: 30 - }); + this._loading = loadingAnimation; this._loading.element.css("zIndex", 1); BI.createWidget({ - type: "bi.absolute", + type: "bi.absolute_center_adapt", element: this, items: [{ el: this._loading, diff --git a/src/less/base/pane.less b/src/less/base/pane.less index fa9dcf2fc..605d44bb8 100644 --- a/src/less/base/pane.less +++ b/src/less/base/pane.less @@ -1,6 +1,34 @@ @import "../index"; - +@import "../resource/background"; .bi-pane { - min-height: 25px; - .background-color(@color-bi-background-normal, 0); + min-height: 55px; + .background-color(@color-bi-background-normal, 0); +} + +.bi-loading-widget { + div { + .background-color(@background-color-highlight, 90%); + .border-radius(2.5px); + .animation(loading-widget 0.8s infinite linear); + } + .rect2 { + .animation-delay(-0.2s); + } + .rect3 { + .animation-delay(-0.4s); + } + .keyframes (loading-widget, { + 0%, 100% { + .transform (scaleY(0.3)); + } + 50% { + .transform (scaleY(1)); + } + }); + &.hack { + .loading-background; + div { + .background-color(@background-color-highlight, 0%); + } + } } \ No newline at end of file diff --git a/src/less/visual.less b/src/less/visual.less index 54c0a4dd2..f7290cb70 100644 --- a/src/less/visual.less +++ b/src/less/visual.less @@ -254,4 +254,47 @@ content: ""; transform: rotate(-45deg); } +} + +// css3 animation +.keyframes(@name, @frames) { + @-webkit-keyframes @name { + @frames(); + } + @-moz-keyframes @name { + @frames(); + } + @-ms-keyframes @name { + @frames(); + } + @-o-keyframes @name { + @frames(); + } + @keyframes @name { + @frames(); + } +} + +.animation(@attr) { + -webkit-animation: @attr; + -moz-animation: @attr; + -ms-animation: @attr; + -o-animation: @attr; + animation: @attr; +} + +.animation-delay(@attr) { + -webkit-animation-delay: @attr; + -moz-animation-delay: @attr; + -ms-animation-delay: @attr; + -o-animation-delay: @attr; + animation-delay: @attr; +} + +.transform(@attr) { + -webkit-transform: @attr; + -moz-transform: @attr; + -o-transform: @attr; + -ms-transform: @attr; + transform: @attr; } \ No newline at end of file