|
@@ -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}
|