Selaa lähdekoodia

Merge branch 'Chronic-ll' into ChronicMag

Luolei 6 vuotta sitten
vanhempi
commit
6017f7d5c4

+ 0 - 1
src/components/PreviewBody/index.jsx

@@ -76,7 +76,6 @@ class PreviewBody extends Component {
   }
   render() {
     const { show, preInfo, dataJson, dataStr, baseObj, flg } = this.props;
-    console.log(dataJson)
     const other_yjs = filterOtherDataArr(JSON.parse(dataStr.other),dataJson.other);
     const noData = JSON.stringify(preInfo) == '{}';
     return <div className={style['content']} style={{ width: flg ? '700' : '820' }}>

+ 16 - 9
src/components/TemplateItems/TemplateItem/index.jsx

@@ -24,7 +24,6 @@ class TemplateItem extends React.Component {
             checkBox:false,
             bgColor:false,
         };
-        this.titleDOM = null;
         this.isConfirmClick = false;
         this.timer = null;
         this.handleTitleClick = this.handleTitleClick.bind(this)
@@ -107,12 +106,21 @@ class TemplateItem extends React.Component {
         this.props.handleTitleChange(currId,name);
     }
 
-    recoverTitle() {
-        this.titleDOM.innerHTML = this.props.title;
-    }
-
     handleTitleClick(e) {
-      if($(e.target).attr('src')){
+      if(e.target.tagName == 'I'){
+        let tmpDomLis = $(e.target).parent().parent().siblings()
+        $(e.target).parent().next().slideToggle()
+        if($(e.target).parent().next().height() == 0){
+          $(e.target).next().attr('src',arrow_down_icon)
+        }else{
+          $(e.target).next().attr('src',arrow_icon)
+        }
+        for(let i = 0;i < tmpDomLis.length;i++){
+          let tmpDiv = tmpDomLis[i]
+          $(tmpDiv).children().eq(1).slideUp()
+          $(tmpDiv).children().eq(0).children('img').eq(0).attr('src',arrow_icon)
+        }
+      }else if($(e.target).attr('src')){
         let tmpDomLis = $(e.target).parent().parent().siblings()
         $(e.target).parent().next().slideToggle()
         if($(e.target).parent().next().height() == 0){
@@ -159,13 +167,12 @@ class TemplateItem extends React.Component {
                             src={this.getCheckIcon()[0]}
                         /></div>:null
                     }
-                    <span
-                        ref={(title) => this.titleDOM = title}
+                    <i
                         className={style['title']}
                         title={name+sexStr}
                     >
                         {name+sexStr}
-                    </span>
+                    </i>
                     <img className={style.arrow} src={arrow_icon} />
                     <img title={'删除模板'} 
                         className={style.del}