import addClass from 'dom-helpers/class/addClass';
import removeClass from 'dom-helpers/class/removeClass';


const map = {};

//parentEl传入需要添加类的节点，portalEl，传入创建的portal节点
function push(parentEl, portalEl) {

    if (!(parentEl in map)) {
        map[parentEl] = [];
    }
    addClass(parentEl, 'portal-parent');
    map[parentEl].push(portalEl);
}

//删除对应的节点，当删除为空的时候，去掉定位的calss
function pop(parentEl, portalEl) {
    map[parentEl].splice(map[parentEl].indexOf(portalEl), 1);
    if (map[parentEl].length < 1) {
        removeClass(parentEl, 'portal-parent');
    }
}

export default {
    push,
    pop
};

@@ -102,17 +102,16 @@
 lass';%0A%0A
-%0A
 const ma
@@ -123,52 +123,8 @@
 %7D;%0A%0A
-//parentEl%E4%BC%A0%E5%85%A5%E9%9C%80%E8%A6%81%E6%B7%BB%E5%8A%A0%E7%B1%BB%E7%9A%84%E8%8A%82%E7%82%B9%EF%BC%8CportalEl%EF%BC%8C%E4%BC%A0%E5%85%A5%E5%88%9B%E5%BB%BA%E7%9A%84portal%E8%8A%82%E7%82%B9%0A
 func
@@ -220,16 +220,17 @@
 ;%0A    %7D%0A
+%0A
     addC
@@ -258,24 +258,25 @@
 l-parent');%0A
+%0A
     map%5Bpare
@@ -301,41 +301,12 @@
 l);%0A
+%0A
 %7D%0A%0A
-//%E5%88%A0%E9%99%A4%E5%AF%B9%E5%BA%94%E7%9A%84%E8%8A%82%E7%82%B9%EF%BC%8C%E5%BD%93%E5%88%A0%E9%99%A4%E4%B8%BA%E7%A9%BA%E7%9A%84%E6%97%B6%E5%80%99%EF%BC%8C%E5%8E%BB%E6%8E%89%E5%AE%9A%E4%BD%8D%E7%9A%84calss%0A
 func
@@ -332,24 +332,25 @@
 portalEl) %7B%0A
+%0A
     map%5Bpare
@@ -399,16 +399,17 @@
 l), 1);%0A
+%0A
     if (
@@ -484,22 +484,23 @@
 rent');%0A
-
     %7D%0A
+%0A
 %7D%0A%0Aexpor

update PortalManagement