Permalink
Browse files

fix: 币种组件不再显示币种效果

  • Loading branch information...
LiuYueKai committed Mar 13, 2017
1 parent 51a2f91 commit 70dac966724abd426752deb00e097dba800707a8
View
@@ -4699,7 +4699,10 @@
var options = this.element.getElementsByTagName('option');
for (i = 0; i < options.length; i++) {
option = options[i];
- datas.push({ value: option.value, name: option.text });
+ datas.push({
+ value: option.value,
+ name: option.text
+ });
}
this._input = this.element.querySelector("input");
@@ -4876,7 +4879,10 @@
(0, _event.off)(document, 'click', this.callback);
(0, _dom.removeClass)(this._ul, 'is-visible');
this._ul.style.zIndex = -1;
- this.trigger('select', { value: this.value, name: this._input.value });
+ this.trigger('select', {
+ value: this.value,
+ name: this._input.value
+ });
},
/**
@@ -4893,7 +4899,10 @@
if (!options) this.comboDatas = datas;else {
this.comboDatas = [];
for (var i = 0; i < datas.length; i++) {
- this.comboDatas.push({ name: datas[i][options.name], value: datas[i][options.value] });
+ this.comboDatas.push({
+ name: datas[i][options.name],
+ value: datas[i][options.value]
+ });
}
}
@@ -4940,6 +4949,9 @@
var flag;
if (this.fullWidth == 0) {
this.fullWidth = this._input.offsetWidth;
+ if (this.fullWidth < 0 || this.fullWidth == 0) {
+ this.fullWidth = parseInt($(this._input).width()) + parseInt($(this._input).css('border-left-width')) * 2 + parseInt($(this._input).css('padding-left')) * 2 + 'px';
+ }
if (this.fullWidth > 0) {
if (this._combo_name_par) {
this._combo_name_par.style.maxWidth = this.fullWidth + 'px';
@@ -5122,7 +5134,10 @@
if (!this.onlySelect && !matched) {
this.value = value;
this._input.value = value;
- this.trigger('select', { value: this.value, name: this._input.value });
+ this.trigger('select', {
+ value: this.value,
+ name: this._input.value
+ });
}
},
@@ -5432,6 +5447,7 @@
var CurrencyAdapter = _keroaFloat.FloatAdapter.extend({
init: function init() {
+ _keroaFloat.FloatAdapter.prototype.init.call(this);
var self = this;
this.maskerMeta = _core.core.getMaskerMeta('currency') || {};
this.maskerMeta.precision = this.getOption('precision') || this.maskerMeta.precision;
@@ -16042,7 +16058,7 @@
fetch = true;
this.slice = true;
(0, _dom.addClass)(this.comp.element, 'is-checked');
- this.comp._btnElement.click();
+ //this.comp._btnElement.click(); // https://github.com/iuap-design/tinper.org/issues/41
this.slice = false;
}
}
@@ -16488,50 +16504,51 @@
/***/ function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) {
- if (true) {
- !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports, __webpack_require__(52), __webpack_require__(56), __webpack_require__(55), __webpack_require__(53), __webpack_require__(15)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
- } else if (typeof exports !== "undefined") {
- factory(exports, require('./keroa-float'), require('tinper-sparrow/src/util/formater'), require('tinper-sparrow/src/util/masker'), require('tinper-sparrow/src/core'), require('compox/src/compMgr'));
- } else {
- var mod = {
- exports: {}
- };
- factory(mod.exports, global.keroaFloat, global.formater, global.masker, global.core, global.compMgr);
- global.keroaPercent = mod.exports;
- }
+ if (true) {
+ !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports, __webpack_require__(52), __webpack_require__(56), __webpack_require__(55), __webpack_require__(53), __webpack_require__(15)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
+ } else if (typeof exports !== "undefined") {
+ factory(exports, require('./keroa-float'), require('tinper-sparrow/src/util/formater'), require('tinper-sparrow/src/util/masker'), require('tinper-sparrow/src/core'), require('compox/src/compMgr'));
+ } else {
+ var mod = {
+ exports: {}
+ };
+ factory(mod.exports, global.keroaFloat, global.formater, global.masker, global.core, global.compMgr);
+ global.keroaPercent = mod.exports;
+ }
})(this, function (exports, _keroaFloat, _formater, _masker, _core, _compMgr) {
- 'use strict';
+ 'use strict';
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.PercentAdapter = undefined;
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ exports.PercentAdapter = undefined;
- /**
- * 百分比控件
- */
- var PercentAdapter = _keroaFloat.FloatAdapter.extend({
- init: function init() {
- this.validType = 'float';
- this.maskerMeta = _core.core.getMaskerMeta('percent') || {};
- this.maskerMeta.precision = this.getOption('precision') || this.maskerMeta.precision;
- if (this.maskerMeta.precision) {
- this.maskerMeta.precision = parseInt(this.maskerMeta.precision) + 2;
- }
- this.formater = new _formater.NumberFormater(this.maskerMeta.precision);
- this.masker = new _masker.PercentMasker(this.maskerMeta);
- }
- }); /**
- * Module : Kero percent
- * Author : Kvkens(yueming@yonyou.com)
- * Date : 2016-08-09 20:02:50
- */
+ /**
+ * 百分比控件
+ */
+ var PercentAdapter = _keroaFloat.FloatAdapter.extend({
+ init: function init() {
+ _keroaFloat.FloatAdapter.prototype.init.call(this);
+ this.validType = 'float';
+ this.maskerMeta = _core.core.getMaskerMeta('percent') || {};
+ this.maskerMeta.precision = this.getOption('precision') || this.maskerMeta.precision;
+ if (this.maskerMeta.precision) {
+ this.maskerMeta.precision = parseInt(this.maskerMeta.precision) + 2;
+ }
+ this.formater = new _formater.NumberFormater(this.maskerMeta.precision);
+ this.masker = new _masker.PercentMasker(this.maskerMeta);
+ }
+ }); /**
+ * Module : Kero percent
+ * Author : Kvkens(yueming@yonyou.com)
+ * Date : 2016-08-09 20:02:50
+ */
- _compMgr.compMgr.addDataAdapter({
- adapter: PercentAdapter,
- name: 'percent'
- });
- exports.PercentAdapter = PercentAdapter;
+ _compMgr.compMgr.addDataAdapter({
+ adapter: PercentAdapter,
+ name: 'percent'
+ });
+ exports.PercentAdapter = PercentAdapter;
});
/***/ },
@@ -17278,6 +17295,7 @@
*/
var LandLineAdapter = _keroaString.StringAdapter.extend({
init: function init() {
+ // StringAdapter.prototype.init.call(this);
var self = this;
this.element = this.element.nodeName === 'INPUT' ? this.element : this.element.querySelector('input');
LandLineAdapter.superclass.init.apply(this);
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -30,6 +30,7 @@
var CurrencyAdapter = _keroaFloat.FloatAdapter.extend({
init: function init() {
+ _keroaFloat.FloatAdapter.prototype.init.call(this);
var self = this;
this.maskerMeta = _core.core.getMaskerMeta('currency') || {};
this.maskerMeta.precision = this.getOption('precision') || this.maskerMeta.precision;
View
@@ -23,6 +23,7 @@
*/
var LandLineAdapter = _keroaString.StringAdapter.extend({
init: function init() {
+ // StringAdapter.prototype.init.call(this);
var self = this;
this.element = this.element.nodeName === 'INPUT' ? this.element : this.element.querySelector('input');
LandLineAdapter.superclass.init.apply(this);
View
@@ -1,46 +1,47 @@
(function (global, factory) {
- if (typeof define === "function" && define.amd) {
- define(['exports', './keroa-float', 'tinper-sparrow/src/util/formater', 'tinper-sparrow/src/util/masker', 'tinper-sparrow/src/core', 'compox/src/compMgr'], factory);
- } else if (typeof exports !== "undefined") {
- factory(exports, require('./keroa-float'), require('tinper-sparrow/src/util/formater'), require('tinper-sparrow/src/util/masker'), require('tinper-sparrow/src/core'), require('compox/src/compMgr'));
- } else {
- var mod = {
- exports: {}
- };
- factory(mod.exports, global.keroaFloat, global.formater, global.masker, global.core, global.compMgr);
- global.keroaPercent = mod.exports;
- }
+ if (typeof define === "function" && define.amd) {
+ define(['exports', './keroa-float', 'tinper-sparrow/src/util/formater', 'tinper-sparrow/src/util/masker', 'tinper-sparrow/src/core', 'compox/src/compMgr'], factory);
+ } else if (typeof exports !== "undefined") {
+ factory(exports, require('./keroa-float'), require('tinper-sparrow/src/util/formater'), require('tinper-sparrow/src/util/masker'), require('tinper-sparrow/src/core'), require('compox/src/compMgr'));
+ } else {
+ var mod = {
+ exports: {}
+ };
+ factory(mod.exports, global.keroaFloat, global.formater, global.masker, global.core, global.compMgr);
+ global.keroaPercent = mod.exports;
+ }
})(this, function (exports, _keroaFloat, _formater, _masker, _core, _compMgr) {
- 'use strict';
+ 'use strict';
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.PercentAdapter = undefined;
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ exports.PercentAdapter = undefined;
- /**
- * 百分比控件
- */
- var PercentAdapter = _keroaFloat.FloatAdapter.extend({
- init: function init() {
- this.validType = 'float';
- this.maskerMeta = _core.core.getMaskerMeta('percent') || {};
- this.maskerMeta.precision = this.getOption('precision') || this.maskerMeta.precision;
- if (this.maskerMeta.precision) {
- this.maskerMeta.precision = parseInt(this.maskerMeta.precision) + 2;
- }
- this.formater = new _formater.NumberFormater(this.maskerMeta.precision);
- this.masker = new _masker.PercentMasker(this.maskerMeta);
- }
- }); /**
- * Module : Kero percent
- * Author : Kvkens(yueming@yonyou.com)
- * Date : 2016-08-09 20:02:50
- */
+ /**
+ * 百分比控件
+ */
+ var PercentAdapter = _keroaFloat.FloatAdapter.extend({
+ init: function init() {
+ _keroaFloat.FloatAdapter.prototype.init.call(this);
+ this.validType = 'float';
+ this.maskerMeta = _core.core.getMaskerMeta('percent') || {};
+ this.maskerMeta.precision = this.getOption('precision') || this.maskerMeta.precision;
+ if (this.maskerMeta.precision) {
+ this.maskerMeta.precision = parseInt(this.maskerMeta.precision) + 2;
+ }
+ this.formater = new _formater.NumberFormater(this.maskerMeta.precision);
+ this.masker = new _masker.PercentMasker(this.maskerMeta);
+ }
+ }); /**
+ * Module : Kero percent
+ * Author : Kvkens(yueming@yonyou.com)
+ * Date : 2016-08-09 20:02:50
+ */
- _compMgr.compMgr.addDataAdapter({
- adapter: PercentAdapter,
- name: 'percent'
- });
- exports.PercentAdapter = PercentAdapter;
+ _compMgr.compMgr.addDataAdapter({
+ adapter: PercentAdapter,
+ name: 'percent'
+ });
+ exports.PercentAdapter = PercentAdapter;
});
View
@@ -204,7 +204,7 @@
fetch = true;
this.slice = true;
(0, _dom.addClass)(this.comp.element, 'is-checked');
- this.comp._btnElement.click();
+ //this.comp._btnElement.click(); // https://github.com/iuap-design/tinper.org/issues/41
this.slice = false;
}
}
View
@@ -20,6 +20,7 @@ import {CurrencyMasker} from 'tinper-sparrow/src/util/masker';
*/
var CurrencyAdapter = FloatAdapter.extend({
init: function () {
+ FloatAdapter.prototype.init.call(this);
var self = this;
this.maskerMeta = core.getMaskerMeta('currency') || {};
this.maskerMeta.precision = this.getOption('precision') || this.maskerMeta.precision;
View
@@ -15,6 +15,7 @@ import {compMgr} from 'compox/src/compMgr';
var PassWordAdapter = StringAdapter.extend({
init: function () {
var oThis = this;
+ StringAdapter.prototype.init.call(this);
if(env.isIE8){
var outStr = this.element.outerHTML;
var l = outStr.length;
@@ -42,7 +43,7 @@ var PassWordAdapter = StringAdapter.extend({
}
});
}
-
+
},
setShowValue: function (showValue) {
this.showValue = showValue;
View
@@ -3,28 +3,41 @@
* Author : Kvkens(yueming@yonyou.com)
* Date : 2016-08-09 20:02:50
*/
-import {FloatAdapter} from './keroa-float';
-import {NumberFormater} from 'tinper-sparrow/src/util/formater';
-import {PercentMasker} from 'tinper-sparrow/src/util/masker';
-import {core} from 'tinper-sparrow/src/core';
-import {compMgr} from 'compox/src/compMgr';
+import {
+ FloatAdapter
+} from './keroa-float';
+import {
+ NumberFormater
+} from 'tinper-sparrow/src/util/formater';
+import {
+ PercentMasker
+} from 'tinper-sparrow/src/util/masker';
+import {
+ core
+} from 'tinper-sparrow/src/core';
+import {
+ compMgr
+} from 'compox/src/compMgr';
/**
* 百分比控件
*/
var PercentAdapter = FloatAdapter.extend({
- init: function () {
+ init: function() {
+ FloatAdapter.prototype.init.call(this);
this.validType = 'float';
this.maskerMeta = core.getMaskerMeta('percent') || {};
this.maskerMeta.precision = this.getOption('precision') || this.maskerMeta.precision;
- if (this.maskerMeta.precision){
+ if (this.maskerMeta.precision) {
this.maskerMeta.precision = parseInt(this.maskerMeta.precision) + 2;
}
this.formater = new NumberFormater(this.maskerMeta.precision);
this.masker = new PercentMasker(this.maskerMeta);
}
});
compMgr.addDataAdapter({
- adapter: PercentAdapter,
- name: 'percent'
+ adapter: PercentAdapter,
+ name: 'percent'
});
-export {PercentAdapter};
+export {
+ PercentAdapter
+};
View
@@ -202,7 +202,7 @@ var RadioAdapter = BaseAdapter.extend({
fetch = true;
this.slice = true;
addClass(this.comp.element,'is-checked')
- this.comp._btnElement.click();
+ //this.comp._btnElement.click(); // https://github.com/iuap-design/tinper.org/issues/41
this.slice = false;
}
}
View
@@ -10,6 +10,7 @@ import {compMgr} from 'compox/src/compMgr';
var UrlAdapter = StringAdapter.extend({
init: function () {
this.validType = 'url';
+ UrlAdapter.superclass.init.apply(this);
/*
* 因为需要输入,因此不显示为超链接
*/
@@ -51,4 +52,3 @@ compMgr.addDataAdapter({
name: 'url'
});
export {UrlAdapter};
-

0 comments on commit 70dac96

Please sign in to comment.