Skip to content

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

@oceatoon

Description

@oceatoon

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
        } 
     });

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions