svghmi/gen_index_xhtml.xslt
branchsvghmi
changeset 2934 ee483e8346f5
parent 2933 ed3f712a8eef
child 2936 53fb11263ff1
equal deleted inserted replaced
2933:ed3f712a8eef 2934:ee483e8346f5
   903 </xsl:text>
   903 </xsl:text>
   904     <xsl:text>    },
   904     <xsl:text>    },
   905 </xsl:text>
   905 </xsl:text>
   906     <xsl:text>    set_selection: function(value) {
   906     <xsl:text>    set_selection: function(value) {
   907 </xsl:text>
   907 </xsl:text>
   908     <xsl:text>        this.text_elt.firstElementChild.textContent = 
   908     <xsl:text>        let display_str;
   909 </xsl:text>
   909 </xsl:text>
   910     <xsl:text>          (value &gt;= 0 &amp;&amp; value &lt; this.content.length) ?
   910     <xsl:text>        if(value &gt;= 0 &amp;&amp; value &lt; this.content.length){
   911 </xsl:text>
   911 </xsl:text>
   912     <xsl:text>            this.content[value] : "?"+String(value)+"?";
   912     <xsl:text>            display_str = this.content[value];
       
   913 </xsl:text>
       
   914     <xsl:text>            this.last_selection = value;
       
   915 </xsl:text>
       
   916     <xsl:text>        } else {
       
   917 </xsl:text>
       
   918     <xsl:text>            display_str = "?"+String(value)+"?";
       
   919 </xsl:text>
       
   920     <xsl:text>        }
       
   921 </xsl:text>
       
   922     <xsl:text>        this.text_elt.firstElementChild.textContent = display_str;
   913 </xsl:text>
   923 </xsl:text>
   914     <xsl:text>    },
   924     <xsl:text>    },
   915 </xsl:text>
   925 </xsl:text>
   916     <xsl:text>    grow_text: function(up_to) {
   926     <xsl:text>    grow_text: function(up_to) {
   917 </xsl:text>
   927 </xsl:text>
  1128     <xsl:text>        if(slots == length) {
  1138     <xsl:text>        if(slots == length) {
  1129 </xsl:text>
  1139 </xsl:text>
  1130     <xsl:text>            this.set_complete_text();
  1140     <xsl:text>            this.set_complete_text();
  1131 </xsl:text>
  1141 </xsl:text>
  1132     <xsl:text>        } else {
  1142     <xsl:text>        } else {
       
  1143 </xsl:text>
       
  1144     <xsl:text>            // align to selection
       
  1145 </xsl:text>
       
  1146     <xsl:text>            let offset = this.last_selection - this.lift;
       
  1147 </xsl:text>
       
  1148     <xsl:text>            if(offset &gt; 0)
       
  1149 </xsl:text>
       
  1150     <xsl:text>                this.menu_offset = Math.min(offset + 1, length - slots + 1);
       
  1151 </xsl:text>
       
  1152     <xsl:text>            else
       
  1153 </xsl:text>
       
  1154     <xsl:text>                this.menu_offset = 0;
  1133 </xsl:text>
  1155 </xsl:text>
  1134     <xsl:text>            this.set_partial_text();
  1156     <xsl:text>            this.set_partial_text();
  1135 </xsl:text>
  1157 </xsl:text>
  1136     <xsl:text>        }
  1158     <xsl:text>        }
  1137 </xsl:text>
  1159 </xsl:text>