svghmi/widget_jump.ysl2
changeset 3512 fce3d407bb46
parent 3242 f037e901a17c
child 3515 b90a0acc8c4e
equal deleted inserted replaced
3511:7c27d57b6ec0 3512:fce3d407bb46
    64             const name = this.args[0];
    64             const name = this.args[0];
    65             return function(evt){
    65             return function(evt){
    66                 /* TODO: in order to allow jumps to page selected through for exemple a dropdown,
    66                 /* TODO: in order to allow jumps to page selected through for exemple a dropdown,
    67                    support path pointing to local variable whom value 
    67                    support path pointing to local variable whom value 
    68                    would be an HMI_TREE index and then jump to a relative page not hard-coded in advance */
    68                    would be an HMI_TREE index and then jump to a relative page not hard-coded in advance */
    69 
       
    70                 if(!that.disabled) {
    69                 if(!that.disabled) {
    71                     const index = that.indexes.length > 0 ? that.indexes[0] + that.offset : undefined;
    70                     const index = that.indexes.length > 0 ? that.indexes[0] + that.offset : undefined;
    72                     switch_page(name, index);
    71                     fading_page_switch(name, index);
    73                 }
    72                 }
    74             }
    73             }
    75         }
    74         }
    76 
    75 
    77         notify_page_change(page_name, index) {
    76         notify_page_change(page_name, index) {
   141         if "not(func:same_class_paths($target_page_path, path[1]/@value))"
   140         if "not(func:same_class_paths($target_page_path, path[1]/@value))"
   142             error > Jump id="«@id»" to page "«$target_page_name»" with incompatible path "«path[1]/@value» (must be same class as "«$target_page_path»")
   141             error > Jump id="«@id»" to page "«$target_page_name»" with incompatible path "«path[1]/@value» (must be same class as "«$target_page_path»")
   143     }
   142     }
   144 }
   143 }
   145 
   144 
       
   145 emit "cssdefs:jump"
       
   146 ||
       
   147 .fade-out-page {
       
   148     animation: fadeOut 0.6s;
       
   149 }
       
   150 
       
   151 @keyframes fadeOut {
       
   152     0% { opacity: 1; }
       
   153     100% { opacity: 0; }
       
   154 }
       
   155 
       
   156 ||
       
   157 
   146 emit "declarations:jump"
   158 emit "declarations:jump"
   147 ||
   159 ||
   148 var jumps_need_update = false;
   160 var jumps_need_update = false;
   149 var jump_history = [[default_page, undefined]];
   161 var jump_history = [[default_page, undefined]];
   150 
   162