Project

General

Profile

« Previous | Next » 

Revision 82836b92

Added by koszko about 2 years ago

fix options_main.js bugs

View differences:

html/options_main.js
632 632

  
633 633
    /*
634 634
     * Reset file <input>. Without this, a second attempt to import the same
635
     * file would result in "change" event on happening on <input> element.
635
     * file would result in "change" event not happening on <input> element.
636 636
     */
637 637
    file_opener_form.reset();
638 638
}
......
684 684
 *
685 685
 * We don't need to worry about the state of the page (e.g. some editing being
686 686
 * in progress) in jump_to_item() - this function is called at the beginning,
687
 * before callbacks are assigned to buttons, so it is safe to assume lists are
688
 * initialized with items and page is in its virgin state with regard to
689
 * everything else.
687
 * together with callbacks being assigned to buttons, so it is safe to assume
688
 * lists are initialized with items and page is in its virgin state with regard
689
 * to everything else.
690 690
 */
691 691
function jump_to_item(url_with_item)
692 692
{
......
717 717
	    add_radio_li(prefix, item);
718 718
	}
719 719

  
720
	jump_to_item(document.URL);
721

  
722 720
	let name = TYPE_NAME[prefix];
723 721

  
724 722
	let add_but = by_id(`add_${name}_but`);
......
745 743
	cancel_components_but.addEventListener("click", cancel_components);
746 744
    }
747 745

  
746
    jump_to_item(document.URL);
747

  
748 748
    initialize_import_facility();
749 749

  
750 750
    storage.add_change_listener(handle_change);

Also available in: Unified diff