Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Ext JS Premium Member
    Join Date
    Mar 2007
    Posts
    4
    Vote Rating
    0
    evan.leonard is on a distinguished road

      0  

    Default LayoutDialog keyListeners not unbound on hide?

    LayoutDialog keyListeners not unbound on hide?


    Hi,
    I'm using the LayoutDialog to create a dialog in my application. I've bound the escape key to the dialog.hide method to close the dialog. I also am using the opening and closing animation using the animateTarget parameter to the show method.


    Code:
    ...
    dialog.addKeyListener(27, dialog.hide, dialog);
    ...
    dialog.show(animateTarget);
    What i've found however is that even after the dialog is hidden, you can still hit the escape key to "close" the dialog again. The animation reruns again each time you hit escape. Shouldn't the keyListeners be unbound when the dialog is hidden?

    Thank you for all the work,
    Evan

  2. #2
    Sencha User jack.slocum's Avatar
    Join Date
    Mar 2007
    Location
    Tampa, FL
    Posts
    6,955
    Vote Rating
    16
    jack.slocum will become famous soon enough

      0  

    Default


    Keys should not be going to the dialog once it is hidden. Is there a field in the dialog possibly retaining the focus?

    After hiding the dialog, you may want to transfer focus to something else if that is the case.

  3. #3
    Sencha User
    Join Date
    Mar 2007
    Posts
    7,854
    Vote Rating
    3
    tryanDLS is on a distinguished road

      0  

    Default


    Just tried that with my simple sample. I see the same thing. Nothing else on the page but the trigger button.

    Code:
    helloWorld = function () {
    	var dlg;
    
    	return {
    		showDialog: function () {
    			if (!dlg) {
    				dlg = new YAHOO.ext.BasicDialog('dlgHello', {
    					width: 300,	height: 300,
    					resizable: true, minWidth:200, minHeight:300,
    					shadow: true,
    					shim: true,
    					animateTarget: 'btn'
    				});
    
    				dlg.addKeyListener(27, dlg.hide, dlg);
    				dlg.setDefaultButton(dlg.addButton('Close', dlg.hide, dlg));
    			}
    
    			dlg.show();
    		},
    
    		init: function() {
    			getEl('btn').on('click', this.showDialog, this, true);
    		}
    	}
    }();
    
    YAHOO.ext.EventManager.onDocumentReady(helloWorld.init, helloWorld, true);

  4. #4
    Sencha User jack.slocum's Avatar
    Join Date
    Mar 2007
    Location
    Tampa, FL
    Posts
    6,955
    Vote Rating
    16
    jack.slocum will become famous soon enough

      0  

    Default


    The reason why is:

    dlg.setDefaultButton(dlg.addButton('Close', dlg.hide, dlg));

    focuses the button. Then when the dialog is hidden, the button still has the focus so keys are still routed to dialog. Make sense?

    I could blur the button, but that is pretty worthless since their could be other stuff in the dialog that has the focus.

    Ideally the key functionality for the basic dialog should be converted to use the KeyMap object. Then it could be enabled/disabled when shown or hidden. It could also provide a way to share key configs across different dialogs, even setting a default key config.

  5. #5
    Sencha User
    Join Date
    Mar 2007
    Posts
    7,854
    Vote Rating
    3
    tryanDLS is on a distinguished road

      0  

    Default


    You could do this for now. In your dialog creation add an event to set focus to some other element on hide. In my sample it just sets focus back to the button that triggered the dialog to begin with

    Code:
    dlg.on('hide', function() {getEl('btn').focus();});

  6. #6
    Ext JS Premium Member
    Join Date
    Mar 2007
    Posts
    4
    Vote Rating
    0
    evan.leonard is on a distinguished road

      0  

    Default Thanks!

    Thanks!


    Thanks Jack and Tryan-
    I'll give those ideas a shot!
    Evan

Similar Threads

  1. LayoutDialog
    By johnsons in forum Ext 1.x: Help & Discussion
    Replies: 1
    Last Post: 29 Mar 2007, 10:14 AM
  2. LayoutDialog Help Please
    By Bobafart in forum Ext 1.x: Help & Discussion
    Replies: 5
    Last Post: 20 Feb 2007, 12:44 AM
  3. element hide hide show bug
    By pomata in forum Ext 1.x: Help & Discussion
    Replies: 1
    Last Post: 9 Dec 2006, 7:16 AM
  4. Need this.shim.hide() in hide func of BasicDialog
    By kalebwalton in forum Community Discussion
    Replies: 1
    Last Post: 25 Nov 2006, 4:29 PM
  5. LayoutDialog issue
    By christocracy in forum Ext 1.x: Help & Discussion
    Replies: 4
    Last Post: 23 Nov 2006, 6:28 PM

Thread Participants: 2