Browse Source

Merge pull request #1 in FUI/fineui from ~GUY/fineui:master to master

* commit '6c944b61ebbc9a917dbe487af640e4c53e0357c3':
  add
master
guy 8 years ago
parent
commit
24da300ff8
  1. 25
      dist/core.js
  2. 11
      src/core/ob.js
  3. 4
      src/core/shortcut.js
  4. 8
      src/core/widget.js
  5. 2
      src/less/base/single/text.less
  6. 2
      src/less/base/table/table.grid.scrollbar.less

25
dist/core.js vendored

@ -14017,8 +14017,8 @@ $.extend(BI.OB.prototype, {
if (this.options.listeners != null) { if (this.options.listeners != null) {
$.each(this.options.listeners, function (i, lis) { $.each(this.options.listeners, function (i, lis) {
(lis.target ? lis.target : self)[lis.once ? 'once' : 'on'] (lis.target ? lis.target : self)[lis.once ? 'once' : 'on']
(lis.eventName, lis.action.createDelegate(self)) (lis.eventName, _.bind(lis.action, self))
}) });
delete this.options.listeners; delete this.options.listeners;
} }
}, },
@ -14114,14 +14114,7 @@ $.extend(BI.OB.prototype, {
} }
return true; return true;
} }
}); });/**
BI.OB.capture = function (o, fn, scope) {
o.fireEvent = o.fireEvent.createInterceptor(fn, scope);
}
// alex:释放事件的捕捉
BI.OB.releaseCapture = function (o) {
o.fireEvent = BI.OB.prototype.fireEvent;
};/**
* Widget超类 * Widget超类
* @class BI.Widget * @class BI.Widget
* @extends BI.OB * @extends BI.OB
@ -14198,6 +14191,7 @@ BI.Widget = BI.inherit(BI.OB, {
}, },
_initVisualEffects: function () { _initVisualEffects: function () {
if (this.options.diabled || this.options.invalid) {
BI.nextTick(BI.bind(function () { BI.nextTick(BI.bind(function () {
if (this.options.disabled) { if (this.options.disabled) {
this.setEnable(false); this.setEnable(false);
@ -14206,6 +14200,7 @@ BI.Widget = BI.inherit(BI.OB, {
this.setValid(false); this.setValid(false);
} }
}, this)); }, this));
}
if (this.options.invisible) { if (this.options.invisible) {
this.setVisible(false); this.setVisible(false);
@ -14223,7 +14218,7 @@ BI.Widget = BI.inherit(BI.OB, {
} }
} }
} else { } else {
var args = Array.prototype.slice.call(arguments, 1) var args = Array.prototype.slice.call(arguments, 1);
for (var i = 0; i < fns.length; i++) { for (var i = 0; i < fns.length; i++) {
if (fns[i].apply(this, args) === false) { if (fns[i].apply(this, args) === false) {
return false; return false;
@ -14264,7 +14259,7 @@ BI.Widget = BI.inherit(BI.OB, {
}, },
setVisible: function (visible) { setVisible: function (visible) {
BI.assert(visible, [true, false]); // BI.assert(visible, [true, false]);
if (visible === true) { if (visible === true) {
this.options.invisible = false; this.options.invisible = false;
this.element.show(); this.element.show();
@ -14276,7 +14271,7 @@ BI.Widget = BI.inherit(BI.OB, {
}, },
setValid: function (valid) { setValid: function (valid) {
BI.assert(valid, [true, false]); // BI.assert(valid, [true, false]);
this.options.invalid = !valid; this.options.invalid = !valid;
if (valid === true) { if (valid === true) {
this.element.removeClass("base-invalid invalid"); this.element.removeClass("base-invalid invalid");
@ -15477,9 +15472,9 @@ BI.View = BI.inherit(BI.V, {
var el; var el;
options || (options = {}); options || (options = {});
if (BI.isEmpty(item) && BI.isEmpty(options)) { if (BI.isEmpty(item) && BI.isEmpty(options)) {
return BI.Plugin.getObject("bi.layout", BI.createWidget({ return BI.createWidget({
type: "bi.layout" type: "bi.layout"
})); });
} }
if (BI.isWidget(item)) { if (BI.isWidget(item)) {
return item; return item;

11
src/core/ob.js

@ -17,8 +17,8 @@ $.extend(BI.OB.prototype, {
if (this.options.listeners != null) { if (this.options.listeners != null) {
$.each(this.options.listeners, function (i, lis) { $.each(this.options.listeners, function (i, lis) {
(lis.target ? lis.target : self)[lis.once ? 'once' : 'on'] (lis.target ? lis.target : self)[lis.once ? 'once' : 'on']
(lis.eventName, lis.action.createDelegate(self)) (lis.eventName, _.bind(lis.action, self))
}) });
delete this.options.listeners; delete this.options.listeners;
} }
}, },
@ -115,10 +115,3 @@ $.extend(BI.OB.prototype, {
return true; return true;
} }
}); });
BI.OB.capture = function (o, fn, scope) {
o.fireEvent = o.fireEvent.createInterceptor(fn, scope);
}
// alex:释放事件的捕捉
BI.OB.releaseCapture = function (o) {
o.fireEvent = BI.OB.prototype.fireEvent;
};

4
src/core/shortcut.js

@ -35,9 +35,9 @@
var el; var el;
options || (options = {}); options || (options = {});
if (BI.isEmpty(item) && BI.isEmpty(options)) { if (BI.isEmpty(item) && BI.isEmpty(options)) {
return BI.Plugin.getObject("bi.layout", BI.createWidget({ return BI.createWidget({
type: "bi.layout" type: "bi.layout"
})); });
} }
if (BI.isWidget(item)) { if (BI.isWidget(item)) {
return item; return item;

8
src/core/widget.js

@ -75,6 +75,7 @@ BI.Widget = BI.inherit(BI.OB, {
}, },
_initVisualEffects: function () { _initVisualEffects: function () {
if (this.options.diabled || this.options.invalid) {
BI.nextTick(BI.bind(function () { BI.nextTick(BI.bind(function () {
if (this.options.disabled) { if (this.options.disabled) {
this.setEnable(false); this.setEnable(false);
@ -83,6 +84,7 @@ BI.Widget = BI.inherit(BI.OB, {
this.setValid(false); this.setValid(false);
} }
}, this)); }, this));
}
if (this.options.invisible) { if (this.options.invisible) {
this.setVisible(false); this.setVisible(false);
@ -100,7 +102,7 @@ BI.Widget = BI.inherit(BI.OB, {
} }
} }
} else { } else {
var args = Array.prototype.slice.call(arguments, 1) var args = Array.prototype.slice.call(arguments, 1);
for (var i = 0; i < fns.length; i++) { for (var i = 0; i < fns.length; i++) {
if (fns[i].apply(this, args) === false) { if (fns[i].apply(this, args) === false) {
return false; return false;
@ -141,7 +143,7 @@ BI.Widget = BI.inherit(BI.OB, {
}, },
setVisible: function (visible) { setVisible: function (visible) {
BI.assert(visible, [true, false]); // BI.assert(visible, [true, false]);
if (visible === true) { if (visible === true) {
this.options.invisible = false; this.options.invisible = false;
this.element.show(); this.element.show();
@ -153,7 +155,7 @@ BI.Widget = BI.inherit(BI.OB, {
}, },
setValid: function (valid) { setValid: function (valid) {
BI.assert(valid, [true, false]); // BI.assert(valid, [true, false]);
this.options.invalid = !valid; this.options.invalid = !valid;
if (valid === true) { if (valid === true) {
this.element.removeClass("base-invalid invalid"); this.element.removeClass("base-invalid invalid");

2
src/less/base/single/text.less

@ -2,5 +2,5 @@
.bi-text{ .bi-text{
.overflow-dot(); .overflow-dot();
word-break: break-all; word-break: break-word;
} }

2
src/less/base/table/table.grid.scrollbar.less

@ -7,6 +7,7 @@
transition-timing-function: ease; transition-timing-function: ease;
user-select: none; user-select: none;
background-color: rgba(0, 0, 0, 0.1); background-color: rgba(0, 0, 0, 0.1);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#19000000, endColorstr=#19000000);
border-radius: 5px; border-radius: 5px;
} }
@ -29,6 +30,7 @@
left: 0; left: 0;
transition-property: background-color; transition-property: background-color;
background-color: rgba(0, 0, 0, 0.1); background-color: rgba(0, 0, 0, 0.1);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#19000000, endColorstr=#19000000);
} }
/* Touching the scroll-track directly makes the scroll-track bolder */ /* Touching the scroll-track directly makes the scroll-track bolder */

Loading…
Cancel
Save