mirror of https://github.com/ElemeFE/element
Table:fix table support for IE9
parent
82a54fa095
commit
b74ccda118
|
@ -1,5 +1,5 @@
|
||||||
import { getCell, getColumnByCell, getRowIdentity } from './util';
|
import { getCell, getColumnByCell, getRowIdentity } from './util';
|
||||||
import { hasClass } from 'element-ui/src/utils/dom';
|
import { hasClass, addClass, removeClass } from 'element-ui/src/utils/dom';
|
||||||
import ElCheckbox from 'element-ui/packages/checkbox';
|
import ElCheckbox from 'element-ui/packages/checkbox';
|
||||||
import ElTooltip from 'element-ui/packages/tooltip';
|
import ElTooltip from 'element-ui/packages/tooltip';
|
||||||
import debounce from 'throttle-debounce/debounce';
|
import debounce from 'throttle-debounce/debounce';
|
||||||
|
@ -98,10 +98,10 @@ export default {
|
||||||
const oldRow = rows[oldVal];
|
const oldRow = rows[oldVal];
|
||||||
const newRow = rows[newVal];
|
const newRow = rows[newVal];
|
||||||
if (oldRow) {
|
if (oldRow) {
|
||||||
oldRow.classList.remove('hover-row');
|
removeClass(oldRow, 'hover-row');
|
||||||
}
|
}
|
||||||
if (newRow) {
|
if (newRow) {
|
||||||
newRow.classList.add('hover-row');
|
addClass(newRow, 'hover-row');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'store.states.currentRow'(newVal, oldVal) {
|
'store.states.currentRow'(newVal, oldVal) {
|
||||||
|
@ -113,12 +113,12 @@ export default {
|
||||||
const oldRow = rows[data.indexOf(oldVal)];
|
const oldRow = rows[data.indexOf(oldVal)];
|
||||||
const newRow = rows[data.indexOf(newVal)];
|
const newRow = rows[data.indexOf(newVal)];
|
||||||
if (oldRow) {
|
if (oldRow) {
|
||||||
oldRow.classList.remove('current-row');
|
removeClass(oldRow, 'current-row');
|
||||||
} else if (rows) {
|
} else if (rows) {
|
||||||
[].forEach.call(rows, row => row.classList.remove('current-row'));
|
[].forEach.call(rows, row => removeClass(row, 'current-row'));
|
||||||
}
|
}
|
||||||
if (newRow) {
|
if (newRow) {
|
||||||
newRow.classList.add('current-row');
|
addClass(newRow, 'current-row');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { hasClass, addClass, removeClass } from 'element-ui/src/utils/dom';
|
||||||
import ElCheckbox from 'element-ui/packages/checkbox';
|
import ElCheckbox from 'element-ui/packages/checkbox';
|
||||||
import ElTag from 'element-ui/packages/tag';
|
import ElTag from 'element-ui/packages/tag';
|
||||||
import Vue from 'vue';
|
import Vue from 'vue';
|
||||||
|
@ -295,7 +296,7 @@ export default {
|
||||||
const columnRect = columnEl.getBoundingClientRect();
|
const columnRect = columnEl.getBoundingClientRect();
|
||||||
const minLeft = columnRect.left - tableLeft + 30;
|
const minLeft = columnRect.left - tableLeft + 30;
|
||||||
|
|
||||||
columnEl.classList.add('noclick');
|
addClass(columnEl, 'noclick');
|
||||||
|
|
||||||
this.dragState = {
|
this.dragState = {
|
||||||
startMouseLeft: event.clientX,
|
startMouseLeft: event.clientX,
|
||||||
|
@ -344,7 +345,7 @@ export default {
|
||||||
document.ondragstart = null;
|
document.ondragstart = null;
|
||||||
|
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
columnEl.classList.remove('noclick');
|
removeClass(columnEl, 'noclick');
|
||||||
}, 0);
|
}, 0);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -395,8 +396,8 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (target && target.tagName === 'TH') {
|
if (target && target.tagName === 'TH') {
|
||||||
if (target.classList.contains('noclick')) {
|
if (hasClass(target, 'noclick')) {
|
||||||
target.classList.remove('noclick');
|
removeClass(target, 'noclick');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue