Results 1 to 9 of 9

Thread: [FIXED][3.0] Ext.ux.TabCloseMenu.js broken

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha - Ext JS Dev Team mschwartz's Avatar
    Join Date
    Nov 2008
    Location
    San Diego, Peoples' Republic of California
    Posts
    2,061
    Vote Rating
    19
      0  

    Default [FIXED][3.0] Ext.ux.TabCloseMenu.js broken

    See: /examples/tabs/tabs-adv.html

    The example doesn't work

  2. #2
    Sencha - Ext JS Dev Team mschwartz's Avatar
    Join Date
    Nov 2008
    Location
    San Diego, Peoples' Republic of California
    Posts
    2,061
    Vote Rating
    19
      0  

    Default

    Additionally, items member removed from Ext.menu.Menu so none of the container methods work on it anymore.

  3. #3
    Sencha - Ext JS Dev Team mschwartz's Avatar
    Join Date
    Nov 2008
    Location
    San Diego, Peoples' Republic of California
    Posts
    2,061
    Vote Rating
    19
      0  

    Default

    Fix:

    Code:
    // Ext.ux.TabCloseMenu.js for 3.0-rc1
    
    // Very simple plugin for adding a close context menu to tabs
    
    Ext.ux.TabCloseMenu = function() {
        var tabs, menu, ctxItem;
        this.init = function(tp) {
            tabs = tp;
            tabs.on('contextmenu', onContextMenu);
        }
    
        function onContextMenu(tabPanel, tab, e) {
            var items = [];
            if (tab.closable) {
                items.push({
                    text: 'Close Tab',
                    handler: function() {
                        tabPanel.remove(tab);
                    }
                });
            }
            var canCloseOthers = false;
            tabPanel.items.each(function() {
                if (this != tab && this.closable) {
                    canCloseOthers = true;
                    return false;
                }
                return true;
            });
            if (canCloseOthers) {
                items.push({
                    text: 'Close Other Tabs',
                    handler: function() {
                        tabPanel.items.each(function() {
                            if (this != tab && this.closable) {
                                tabPanel.remove(this);
                            }
                        })
                    }
                })
            }
            var menu = new Ext.menu.Menu({
                items: items
            });
            menu.showAt(e.getXY());
        }
    };

  4. #4
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    18,600
    Vote Rating
    874
      0  

    Default

    Fixed in SVN.
    Evan Trimboli
    Twitter - @evantrimboli

  5. #5
    Ext JS Premium Member stever's Avatar
    Join Date
    Mar 2007
    Posts
    1,408
    Vote Rating
    9
      0  

    Default

    I don't think you meant to keep that console.log in there!!


  6. #6
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    18,600
    Vote Rating
    874
      0  

    Default

    Cut me some slack, I just landed back in Sydney

    Removed the log() statement.
    Evan Trimboli
    Twitter - @evantrimboli

  7. #7
    Ext JS Premium Member stever's Avatar
    Join Date
    Mar 2007
    Posts
    1,408
    Vote Rating
    9
      0  

    Default

    Hahaha! No problem, not a complaint or anything, just a heads up. Part of me hesitates to mention it, but part of me knows it is easier to spot now than later...

    I tend to review changes from SVN; it is a good way to learn things. Take docs, for example. When some are changed I can see how the wording changed to make things clearer, or how to use something new without having to hunt for changes by rereading all the docs again.

    Which is also why I hate big changes in SVN. I'll never get through a big changeset, so I'll never learn much about whatever that big new thing is. Wish the designer were in SVN all this time. Could see how it changes over time, learn what the author learns. Or some other big example that gets improved on a continuous basis. Particularly from ExtJS people, as they would use the best practices on a public project like that.

  8. #8
    Sencha - Ext JS Dev Team mschwartz's Avatar
    Join Date
    Nov 2008
    Location
    San Diego, Peoples' Republic of California
    Posts
    2,061
    Vote Rating
    19
      0  

    Default

    Perhaps in Ext.js (the file), you could detect if window.console exists, and if not, create stubs for it so console.* functions won't break?

  9. #9
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    18,600
    Vote Rating
    874
      0  

    Default

    I'm just kidding, we appreciate the reports
    Evan Trimboli
    Twitter - @evantrimboli

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •