Authored by htoooth

增加function bind polyfill,修证部分css样式问题

... ... @@ -58,7 +58,8 @@
<div class="search-input">
<form id="search-form" action="{{../siteUrl}}/product/query">
<span class="iconfont left">&#xe605;</span>
<input type="text" name="query" id="search-key" class="search-key" placeholder="search"autocomplete="off">
<input type="text" name="query" id="search-key" class="search-key" placeholder="search"
autocomplete="off">
<span class="iconfont right clear-input">&#xe608;</span>
</form>
</div>
... ...
/**
* Created by TaoHuang on 2016/7/29.
*/
if (!Function.prototype.bind) {
Function.prototype.bind = function(oThis) { //eslint-disable-line
if (typeof this !== 'function') {
// closest thing possible to the ECMAScript 5
// internal IsCallable function
throw new TypeError('Function.prototype.bind - what is trying to be bound is not callable');
}
var aArgs = Array.prototype.slice.call(arguments, 1),
fToBind = this,
fNOP = function() {
},
fBound = function() {
return fToBind.apply(this instanceof fNOP ? this : oThis,
aArgs.concat(Array.prototype.slice.call(arguments)));
};
if (this.prototype) {
// Function.prototype doesn't have a prototype property
fNOP.prototype = this.prototype;
}
fBound.prototype = new fNOP();
return fBound;
};
}
\ No newline at end of file
... ...
// 订单剩余时间显示及倒计时
require('../../common/bind-polyfill');
module.exports = {
count: null,
intervalTimer: null,
... ...
... ... @@ -73,15 +73,14 @@ function validateData() {
var k = getValidateKey(input.id);
if (k && validateMap[k]) {
if (!validate.do(validateMap[k].sl, validateMap[k].v)) {
if (!validate.do2(validateMap[k].sl, validateMap[k].v)) {
pass = false;
}
}
});
// 检查选填项
if ($phone.val().length > 0 &&
!validate.do(validateMap.phone.sl, validateMap.phone.v)) {
if ($phone.val().length > 0 && !validate.do2(validateMap.phone.sl, validateMap.phone.v)) {
pass = false;
}
... ... @@ -200,7 +199,7 @@ function showDiaglog(tpl, onEdit) {
var v = validateMap[getValidateKey($this.get(0).id)];
if ($this.val().length > 0) {
validate.do(v.sl, v.v);
validate.do2(v.sl, v.v);
}
});
}
... ...
... ... @@ -93,7 +93,7 @@ function validateAddr(val, conditions) {
}
module.exports = {
do: validate,
do2: validate,
addr: validateAddr
};
... ...
... ... @@ -303,7 +303,7 @@
}
.column {
display: inline-block;
float: left;
text-align: left !important;
.text {
... ...