Ignore:
Timestamp:
Aug 21, 2019 7:44:47 PM (6 years ago)
Author:
anonymous
Message:

use localstorage to store/restore settings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/testa/js/menux.js

    r23 r25  
    1212
    1313function menu_action( part, item_name , up_flag = false ) {
     14    if( Globalx[part].key != '/' ){
     15       
     16    }
     17
    1418    let realData = get_filelist( Globalx.num )
    1519    Globalx[part].key_indicate_file = false;
     
    121125function bookmark_op(part) {
    122126    if( $( Globalx[part].bookmark_op_sel ).is(':checked') == true ){
    123         console.log( Globalx[part].key +" add_bookmark" )
    124127        add_bookmark(part)
    125128    }
    126129    else{
    127         console.log( Globalx[part].key +" remove_bookmark")
    128130        remove_bookmark(part)
    129131    }
     
    131133
    132134function add_bookmark( part ) {
    133     Globalx[part].bookmark_mgr.add( Globalx[part].key )
    134     rebuild_bookmark_menu( part )
    135135    $( '#bookmark_displayname' ).val( Globalx[part].bookmark_mgr.get_restricted_display_name( Globalx[part].key ) )
    136136    $( '#bookmark_path' ).val( Globalx[part].key )
    137137    $('#bookmarkDlg').dialog("open")
    138    
     138}
     139
     140function register_bookmark_( part , path, displayname ) {
     141    Globalx[part].bookmark_mgr.add( path , displayname )
     142    rebuild_bookmark_menu( part )
    139143}
    140144
     
    162166        return
    163167    }
     168    if(key === Globalx[part].key){
     169        return
     170    }
     171
    164172    let realData = get_filelist( Globalx.num )
    165173    Globalx[part].key = key
     
    176184        });
    177185    }
     186    else{
     187        Globalx[part].key_indicate_file = false
     188        Globalx[part].editor.getSession().setValue( "" );
     189        $( Globalx[part].textarea_sel ).val( "" );
     190    }
    178191    const bookmark_cb = $( Globalx[part].bookmark_op_sel )
    179192    bookmark_cb.prop('checked', true)
     193
     194    $( Globalx[part].menu_sel ).empty()
     195
     196    make_menu_item_list(part, realData)
    180197}
     198
Note: See TracChangeset for help on using the changeset viewer.