Grammalecte  Check-in [e23d926562]

Overview
Comment:[fx] WebExt: clear registered node when closing panel
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | fx | webext3
Files: files | file ages | folders
SHA3-256: e23d926562b4553b2f0e7c3fb4c942419b1046f76247c874c2192eebca53d90d
User & Date: olr on 2017-10-13 13:27:26
Other Links: branch diff | manifest | tags
Context
2017-10-13
13:30
[core][js] remove debug function check-in: 9300a9349a user: olr tags: core, webext3
13:27
[fx] WebExt: clear registered node when closing panel check-in: e23d926562 user: olr tags: fx, webext3
13:14
[fx] WebExt: check if right-clicked element have been registered (they aren’t in iframe!) check-in: b7c9949be0 user: olr tags: fx, webext3
Changes

Modified gc_lang/fr/webext/content_scripts/init.js from [d603139c87] to [d9498e4b46].

    50     50       xRightClickedNode: null,
    51     51   
    52     52       listenRightClick: function () {
    53     53           document.addEventListener('contextmenu', function (xEvent) {
    54     54               this.xRightClickedNode = xEvent.target;
    55     55           }.bind(this), true);
    56     56       },
           57  +
           58  +    clearRightClickedNode: function () {
           59  +        this.xRightClickedNode = null;
           60  +    },
    57     61   
    58     62       createMenus: function () {
    59     63           let lNode = document.getElementsByTagName("textarea");
    60     64           for (let xNode of lNode) {
    61     65               if (xNode.style.display !== "none" && xNode.style.visibility !== "hidden") {
    62     66                   this.lMenu.push(new GrammalecteMenu(this.nMenu, xNode));
    63     67                   this.nMenu += 1;

Modified gc_lang/fr/webext/content_scripts/panel.js from [18e69bae0d] to [9619f1038a].

    88     88   
    89     89       show () {
    90     90           this.xPanel.style.display = "block";
    91     91       }
    92     92   
    93     93       hide () {
    94     94           this.xPanel.style.display = "none";
           95  +        oGrammalecte.clearRightClickedNode();
    95     96       }
    96     97   
    97     98       center () {
    98     99           let nHeight = (this.bFlexible) ? window.innerHeight-100 : this.nHeight;
    99    100           this.xPanel.style = `top: 50%; left: 50%; width: ${this.nWidth}px; height: ${nHeight}px; margin-top: -${nHeight/2}px; margin-left: -${this.nWidth/2}px;`;
   100    101       }
   101    102