svghmi/gen_index_xhtml.xslt
branchsvghmi
changeset 2933 ed3f712a8eef
parent 2932 abb995a30088
child 2934 ee483e8346f5
equal deleted inserted replaced
2932:abb995a30088 2933:ed3f712a8eef
   865 </xsl:text>
   865 </xsl:text>
   866     <xsl:text>        this.lift = 0;
   866     <xsl:text>        this.lift = 0;
   867 </xsl:text>
   867 </xsl:text>
   868     <xsl:text>        this.opened = false;
   868     <xsl:text>        this.opened = false;
   869 </xsl:text>
   869 </xsl:text>
   870     <xsl:text>        this.bound_inhibit_click_elsewhere = this.inhibit_click_elsewhere.bind(this);
   870     <xsl:text>        this.bound_close_on_click_elsewhere = this.close_on_click_elsewhere.bind(this);
   871 </xsl:text>
   871 </xsl:text>
   872     <xsl:text>    },
   872     <xsl:text>    },
   873 </xsl:text>
   873 </xsl:text>
   874     <xsl:text>    on_selection_click: function(selection) {
   874     <xsl:text>    on_selection_click: function(selection) {
   875 </xsl:text>
   875 </xsl:text>
   975 </xsl:text>
   975 </xsl:text>
   976     <xsl:text>        return count;
   976     <xsl:text>        return count;
   977 </xsl:text>
   977 </xsl:text>
   978     <xsl:text>    },
   978     <xsl:text>    },
   979 </xsl:text>
   979 </xsl:text>
   980     <xsl:text>    inhibit_click_elsewhere: function(e) {
   980     <xsl:text>    close_on_click_elsewhere: function(e) {
   981 </xsl:text>
   981 </xsl:text>
   982     <xsl:text>        console.log("inhibit", e);
   982     <xsl:text>        console.log("inhibit", e);
   983 </xsl:text>
   983 </xsl:text>
   984     <xsl:text>        console.log(e.target.parentNode, this.text_elt);
   984     <xsl:text>        console.log(e.target.parentNode, this.text_elt);
   985 </xsl:text>
   985 </xsl:text>
   986     <xsl:text>        if(e.target.parentNode !== this.text_elt)
   986     <xsl:text>        if(e.target.parentNode !== this.text_elt){
   987 </xsl:text>
   987 </xsl:text>
   988     <xsl:text>            e.stopPropagation();
   988     <xsl:text>            e.stopPropagation();
   989 </xsl:text>
   989 </xsl:text>
       
   990     <xsl:text>            if(e.target !== this.box_elt)
       
   991 </xsl:text>
       
   992     <xsl:text>                this.close();
       
   993 </xsl:text>
       
   994     <xsl:text>        }
       
   995 </xsl:text>
   990     <xsl:text>    },
   996     <xsl:text>    },
   991 </xsl:text>
   997 </xsl:text>
   992     <xsl:text>    close: function(){
   998     <xsl:text>    close: function(){
   993 </xsl:text>
   999 </xsl:text>
   994     <xsl:text>        document.removeEventListener("click", this.bound_inhibit_click_elsewhere, true);
  1000     <xsl:text>        document.removeEventListener("click", this.bound_close_on_click_elsewhere, true);
   995 </xsl:text>
  1001 </xsl:text>
   996     <xsl:text>        this.reset_text();
  1002     <xsl:text>        this.reset_text();
   997 </xsl:text>
  1003 </xsl:text>
   998     <xsl:text>        this.reset_box();
  1004     <xsl:text>        this.reset_box();
   999 </xsl:text>
  1005 </xsl:text>
  1135 </xsl:text>
  1141 </xsl:text>
  1136     <xsl:text>        this.element.parentNode.appendChild(this.element.parentNode.removeChild(this.element));
  1142     <xsl:text>        this.element.parentNode.appendChild(this.element.parentNode.removeChild(this.element));
  1137 </xsl:text>
  1143 </xsl:text>
  1138     <xsl:text>        // disable interaction with background
  1144     <xsl:text>        // disable interaction with background
  1139 </xsl:text>
  1145 </xsl:text>
  1140     <xsl:text>        document.addEventListener("click", this.bound_inhibit_click_elsewhere, true);
  1146     <xsl:text>        document.addEventListener("click", this.bound_close_on_click_elsewhere, true);
  1141 </xsl:text>
  1147 </xsl:text>
  1142     <xsl:text>        this.opened = true;
  1148     <xsl:text>        this.opened = true;
  1143 </xsl:text>
  1149 </xsl:text>
  1144     <xsl:text>    },
  1150     <xsl:text>    },
  1145 </xsl:text>
  1151 </xsl:text>