Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stop event propagation, or stop navigation when no children #26

Open
oceatoon opened this issue Jul 23, 2019 · 2 comments
Open

stop event propagation, or stop navigation when no children #26

oceatoon opened this issue Jul 23, 2019 · 2 comments

Comments

@oceatoon
Copy link

HI
First of all thanks for the marvelous work produced !!
I'm using item-selected event
but on click in some case I'd like to preventDefault behavior, cause when children are empty it repeats the navigation tree base instead of stoping
is there a way to manage this ?

emitter.on('item-selected', function(item) {
        console.warn('Item selected', item.item["_item"]);
        
        if( item.item["_item"].open == "column" ){
            emitter.emit( 'create-column' , createSimpleColumn(item.item["_item"]) );
        }
        else if( item.item["_item"].open == "page" ){
            window.open(baseUrl+'/costum/co/index/id/ctenat#"@'+item.item["_item"].slug);
            //TODO : preventDefault event
        }
        else if( item.item["_item"].open == "finder" ){
            window.location.href = baseUrl+'/graph/<?php echo Yii::app()->controller->id ?>/finder/slug/'+item.item["_item"].slug+"/open/element";
            //TODO : preventDefault event
        } 
     });
@oceatoon oceatoon changed the title stop event propagation stop event propagation, or stop navigation when no children Jul 23, 2019
@mynameistechno
Copy link
Owner

Sorry for the delay in response, been busy with work. Have you solved this?

@oceatoon
Copy link
Author

no worries thank you for answering
no I had to leave as it is , so it's buggy and can't go to production yet
thanks for your help

Repository owner locked and limited conversation to collaborators Feb 26, 2024
Repository owner deleted a comment from roneyfraga Mar 18, 2024
Repository owner deleted a comment from roneyfraga Mar 18, 2024
@github-staff github-staff deleted a comment from wenxingxing Mar 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@oceatoon @mynameistechno and others