Skip to content

Commit

Permalink
Merge pull request Tencent#39 from Maizify/dev
Browse files Browse the repository at this point in the history
fix issue Tencent#37 & issue Tencent#38, improve style
  • Loading branch information
Maizify authored Jun 16, 2016
2 parents 11f2cb7 + 301df1f commit 1d248cd
Show file tree
Hide file tree
Showing 6 changed files with 2,510 additions and 22 deletions.
2,490 changes: 2,488 additions & 2 deletions dist/vconsole.min.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/core/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,8 @@ class VConsole {
return;
}
let $defaultBtn = $.one('.vc-tool-last');
for (let item of toolList) {
for (let i=0; i<toolList.length; i++) {
let item = toolList[i];
let $item = $.render(tplToolItem, {
name: item.name || 'Undefined',
pluginID: plugin.id
Expand Down
10 changes: 5 additions & 5 deletions src/core/core.less
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@

.vc-tabbar {
border-bottom: 1px solid #D9D9D9;
overflow: scroll;
overflow-x: auto;
height: 39px;
width: auto;
white-space: nowrap;
Expand All @@ -90,7 +90,7 @@
.vc-content {
background-color: #FFF;
overflow-x: hidden;
overflow-y: scroll;
overflow-y: auto;
position: absolute;
top: 40px;
left: 0;
Expand Down Expand Up @@ -180,7 +180,7 @@
.vc-item .vc-item-code {
display: block;
white-space: pre-wrap;
overflow: scroll;
overflow: auto;
position: relative;
}
.vc-item .vc-item-code.vc-item-code-input,
Expand All @@ -202,7 +202,7 @@

.vc-item .vc-fold {
display: block;
overflow: scroll;
overflow: auto;
-webkit-overflow-scrolling: touch;

.vc-fold-outer {
Expand Down Expand Up @@ -351,7 +351,7 @@
flex: 1;
padding: 3px 4px;
border-left: 1px solid #EEE;
overflow: scroll;
overflow: auto;
white-space: pre-wrap;
word-break: break-word;
/*white-space: nowrap;
Expand Down
22 changes: 11 additions & 11 deletions src/lib/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ $.addClass = function($el, className) {
if (!isArray($el)) {
$el = [$el];
}
for (let $e of $el) {
$e.className += ' ' + className;
for (let i=0; i<$el.length; i++) {
$el[i].className += ' ' + className;
}
}

Expand All @@ -65,14 +65,14 @@ $.removeClass = function($el, className) {
if (!isArray($el)) {
$el = [$el];
}
for (let $e of $el) {
let arr = $e.className.split(' ');
for (let i=0; i<$el.length; i++) {
let arr = $el[i].className.split(' ');
for (let j=0; j<arr.length; j++) {
if (arr[j] == className) {
arr[j] = '';
}
}
$e.className = arr.join(' ').trim();
$el[i].className = arr.join(' ').trim();
}
}

Expand All @@ -85,8 +85,8 @@ $.hasClass = function($el, className) {
return false;
}
let arr = $el.className.split(' ');
for (let name of arr) {
if (name == className) {
for (let i=0; i<arr.length; i++) {
if (arr[i] == className) {
return true;
}
}
Expand All @@ -111,8 +111,8 @@ $.bind = function($el, eventType, fn, useCapture) {
if (!isArray($el)) {
$el = [$el];
}
for (let $e of $el) {
$e.addEventListener(eventType, fn, useCapture);
for (let i=0; i<$el.length; i++) {
$el[i].addEventListener(eventType, fn, useCapture);
}
}

Expand All @@ -132,10 +132,10 @@ $.delegate = function($el, eventType, selector, fn) {
return;
}
findTarget:
for (let $target of targets) {
for (let i=0; i<targets.length; i++) {
let $node = e.target;
while ($node) {
if ($node == $target) {
if ($node == targets[i]) {
fn.call($node, e);
break findTarget;
}
Expand Down
4 changes: 2 additions & 2 deletions src/log/log.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ class VConsoleLogTab extends VConsolePlugin {
onInit() {
this.isReady = true;
this.$tabbox = $.render(this.tplTabbox, {});
for (let item of this.logList) {
this.printLog(item);
for (let i=0; i<this.logList.length; i++) {
this.printLog(this.logList[i]);
}
this.logList = [];
}
Expand Down
3 changes: 2 additions & 1 deletion src/network/network.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,8 @@ class VConsoleNetworkTab extends VConsolePlugin {
let header = XMLReq.getAllResponseHeaders() || '',
headerArr = header.split("\n");
// extract plain text to key-value format
for (let line of headerArr) {
for (let i=0; i<headerArr.length; i++) {
let line = headerArr[i];
if (!line) { continue; }
let arr = line.split(': ');
let key = arr[0],
Expand Down

0 comments on commit 1d248cd

Please sign in to comment.