|
@@ -4,9 +4,9 @@ function CoolInput(setting) {
|
|
var _this = this;
|
|
var _this = this;
|
|
_this.cursorPosition = -1;
|
|
_this.cursorPosition = -1;
|
|
_this.cursorX = -1;
|
|
_this.cursorX = -1;
|
|
|
|
+ _this.cursorT=-1;//
|
|
_this.focused = false;
|
|
_this.focused = false;
|
|
_this.inputEl = $(setting.slt);
|
|
_this.inputEl = $(setting.slt);
|
|
- _this.myScale = setting.myScale;
|
|
|
|
var modelVar = _this.inputEl.attr('v-model');
|
|
var modelVar = _this.inputEl.attr('v-model');
|
|
_this.inputEl.attr('readonly', 'readonly');
|
|
_this.inputEl.attr('readonly', 'readonly');
|
|
if (_this.inputEl.length === 0) throw (slt + ' not exist');
|
|
if (_this.inputEl.length === 0) throw (slt + ' not exist');
|
|
@@ -14,6 +14,7 @@ function CoolInput(setting) {
|
|
|
|
|
|
if (!CoolInput.arrInputEl) CoolInput.arrInputEl = [];
|
|
if (!CoolInput.arrInputEl) CoolInput.arrInputEl = [];
|
|
CoolInput.arrInputEl.push(input);
|
|
CoolInput.arrInputEl.push(input);
|
|
|
|
+
|
|
function IsPC() {
|
|
function IsPC() {
|
|
var userAgentInfo = navigator.userAgent;
|
|
var userAgentInfo = navigator.userAgent;
|
|
var Agents = ["Android", "iPhone", "Windows Phone", "iPad", "iPod"];
|
|
var Agents = ["Android", "iPhone", "Windows Phone", "iPad", "iPod"];
|
|
@@ -52,7 +53,6 @@ function CoolInput(setting) {
|
|
tmpDiv = window.coolInputTmpDiv = $('<div style="position:fixed;display:block;z-index:99999;top:300px;left:100px;visibility:hidden;"><div>');
|
|
tmpDiv = window.coolInputTmpDiv = $('<div style="position:fixed;display:block;z-index:99999;top:300px;left:100px;visibility:hidden;"><div>');
|
|
$(document.body).append(tmpDiv);
|
|
$(document.body).append(tmpDiv);
|
|
|
|
|
|
-
|
|
|
|
// tmpDiv.css('top', _this.inputEl.offset().top - 30 + 'px');
|
|
// tmpDiv.css('top', _this.inputEl.offset().top - 30 + 'px');
|
|
//tmpDiv.css('left', _this.inputEl.offset().left + 'px');
|
|
//tmpDiv.css('left', _this.inputEl.offset().left + 'px');
|
|
}
|
|
}
|
|
@@ -226,23 +226,19 @@ border-width:1px;border-style:solid;border-color:#cacaca;border-top-style:none;b
|
|
//var ht=sz.height+2;
|
|
//var ht=sz.height+2;
|
|
}
|
|
}
|
|
|
|
|
|
- var pad = 0;
|
|
|
|
- var pad2 = 0;
|
|
|
|
- var cx = _this.inputEl.offset().left + (_this.cursorX+10)*_this.myScale;
|
|
|
|
- var cy = _this.inputEl.offset().top;
|
|
|
|
- var ht = _this.inputEl.height();
|
|
|
|
- if (_this.myScale==1)
|
|
|
|
- {
|
|
|
|
- pad = 8;
|
|
|
|
- pad2=ht-7*2;
|
|
|
|
- }else {
|
|
|
|
- pad2=(ht-6*2)*_this.myScale;
|
|
|
|
- pad = 20;
|
|
|
|
|
|
+
|
|
|
|
+ var cx = _this.inputEl.offset().left + _this.cursorX+5;
|
|
|
|
+ var cy =_this.cursorT+3;
|
|
|
|
+ var ht = _this.inputEl.height()-4;
|
|
|
|
+ // var cy = _this.inputEl.offset().top+3;
|
|
|
|
+ if (navigator.userAgent.indexOf("iPhone") > 0) {
|
|
|
|
+ cx = _this.inputEl.offset().left + _this.cursorX+10;
|
|
|
|
+ cy =_this.cursorT+5;
|
|
}
|
|
}
|
|
- _this.divCursor.height(pad2);
|
|
|
|
- _this.divCursor.css('left', cx + 'px');
|
|
|
|
- _this.divCursor.css('top', cy+pad + 'px');
|
|
|
|
|
|
|
|
|
|
+ _this.divCursor.height(ht);
|
|
|
|
+ _this.divCursor.css('left', cx + 'px');
|
|
|
|
+ _this.divCursor.css('top', cy + 'px');
|
|
|
|
|
|
if (bShow) {
|
|
if (bShow) {
|
|
_this.divCursor.show();
|
|
_this.divCursor.show();
|