Browse Source

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

* commit '1c5052378fac9ac05855ebb77aa1474675eb23cf':
  add
es6
guy 8 years ago
parent
commit
6c944b61eb
  1. 45
      dist/core.js
  2. 13
      src/core/ob.js
  3. 4
      src/core/shortcut.js
  4. 28
      src/core/widget.js
  5. 2
      src/less/base/single/text.less
  6. 8
      src/less/base/table/table.grid.scrollbar.less

45
dist/core.js vendored

@ -14017,8 +14017,8 @@ $.extend(BI.OB.prototype, {
if (this.options.listeners != null) {
$.each(this.options.listeners, function (i, lis) {
(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;
}
},
@ -14114,14 +14114,7 @@ $.extend(BI.OB.prototype, {
}
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超类
* @class BI.Widget
* @extends BI.OB
@ -14198,14 +14191,16 @@ BI.Widget = BI.inherit(BI.OB, {
},
_initVisualEffects: function () {
BI.nextTick(BI.bind(function () {
if (this.options.disabled) {
this.setEnable(false);
}
if (this.options.invalid) {
this.setValid(false);
}
}, this));
if (this.options.diabled || this.options.invalid) {
BI.nextTick(BI.bind(function () {
if (this.options.disabled) {
this.setEnable(false);
}
if (this.options.invalid) {
this.setValid(false);
}
}, this));
}
if (this.options.invisible) {
this.setVisible(false);
@ -14223,7 +14218,7 @@ BI.Widget = BI.inherit(BI.OB, {
}
}
} 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++) {
if (fns[i].apply(this, args) === false) {
return false;
@ -14264,7 +14259,7 @@ BI.Widget = BI.inherit(BI.OB, {
},
setVisible: function (visible) {
BI.assert(visible, [true, false]);
// BI.assert(visible, [true, false]);
if (visible === true) {
this.options.invisible = false;
this.element.show();
@ -14276,7 +14271,7 @@ BI.Widget = BI.inherit(BI.OB, {
},
setValid: function (valid) {
BI.assert(valid, [true, false]);
// BI.assert(valid, [true, false]);
this.options.invalid = !valid;
if (valid === true) {
this.element.removeClass("base-invalid invalid");
@ -14383,11 +14378,11 @@ BI.Widget = BI.inherit(BI.OB, {
return this.options[key];
},
getText : function() {
getText: function () {
},
setText : function(text) {
setText: function (text) {
},
@ -15477,9 +15472,9 @@ BI.View = BI.inherit(BI.V, {
var el;
options || (options = {});
if (BI.isEmpty(item) && BI.isEmpty(options)) {
return BI.Plugin.getObject("bi.layout", BI.createWidget({
return BI.createWidget({
type: "bi.layout"
}));
});
}
if (BI.isWidget(item)) {
return item;

13
src/core/ob.js

@ -17,8 +17,8 @@ $.extend(BI.OB.prototype, {
if (this.options.listeners != null) {
$.each(this.options.listeners, function (i, lis) {
(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;
}
},
@ -114,11 +114,4 @@ $.extend(BI.OB.prototype, {
}
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;
options || (options = {});
if (BI.isEmpty(item) && BI.isEmpty(options)) {
return BI.Plugin.getObject("bi.layout", BI.createWidget({
return BI.createWidget({
type: "bi.layout"
}));
});
}
if (BI.isWidget(item)) {
return item;

28
src/core/widget.js

@ -75,14 +75,16 @@ BI.Widget = BI.inherit(BI.OB, {
},
_initVisualEffects: function () {
BI.nextTick(BI.bind(function () {
if (this.options.disabled) {
this.setEnable(false);
}
if (this.options.invalid) {
this.setValid(false);
}
}, this));
if (this.options.diabled || this.options.invalid) {
BI.nextTick(BI.bind(function () {
if (this.options.disabled) {
this.setEnable(false);
}
if (this.options.invalid) {
this.setValid(false);
}
}, this));
}
if (this.options.invisible) {
this.setVisible(false);
@ -100,7 +102,7 @@ BI.Widget = BI.inherit(BI.OB, {
}
}
} 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++) {
if (fns[i].apply(this, args) === false) {
return false;
@ -141,7 +143,7 @@ BI.Widget = BI.inherit(BI.OB, {
},
setVisible: function (visible) {
BI.assert(visible, [true, false]);
// BI.assert(visible, [true, false]);
if (visible === true) {
this.options.invisible = false;
this.element.show();
@ -153,7 +155,7 @@ BI.Widget = BI.inherit(BI.OB, {
},
setValid: function (valid) {
BI.assert(valid, [true, false]);
// BI.assert(valid, [true, false]);
this.options.invalid = !valid;
if (valid === true) {
this.element.removeClass("base-invalid invalid");
@ -260,11 +262,11 @@ BI.Widget = BI.inherit(BI.OB, {
return this.options[key];
},
getText : function() {
getText: function () {
},
setText : function(text) {
setText: function (text) {
},

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

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

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

@ -7,14 +7,15 @@
transition-timing-function: ease;
user-select: none;
background-color: rgba(0, 0, 0, 0.1);
border-radius:5px;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#19000000, endColorstr=#19000000);
border-radius: 5px;
}
.scrollbar-layout-main-vertical {
bottom: 0;
right: 0;
top: 0;
transition-property: background-color ;
transition-property: background-color;
width: 10px;
}
@ -27,8 +28,9 @@
bottom: 0;
height: 10px;
left: 0;
transition-property: background-color ;
transition-property: background-color;
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 */

Loading…
Cancel
Save