require(['jquery', "../../../webjars/xwiki-platform-tree-webjar/12.9/require-config.min.js"], function($) {
/*
  $(window.top).on('click', function(evt) {
  evt.preventDefault();
  // Do whatever logic here
}),
*/
  $(document).ready(function(){
    $("a.jstree-anchor").click(function(ev){
      ev.preventDefault();
      alert("clicked AAA:"+this.href);
     });//click
  }),//ready
  require(['tree'], function($) {
  $(document).ready(function(){
    //$('.jstree').on("click", ".jstree-anchor", function (e, data) {
    //$('.xtree').on("activate_node.jstree", function (e, data) {
    $('.xtree').delegate("a.jstree-anchor", "click", function (event, data) { event.preventDefault(); }),
    $('.xtree').on("click", "a.jstree-anchor", function (e, data) {
           e.preventDefault();
           e.stopPropagation();
           e.stopImmediatePropagation();
           $("#contentcolumn").load(this.href + " #contentcolumn" );
           return false;
           alert("activated:"+this.href);
    });//onclick
    });//ready
  });//require
});
