parameters: (self, item_div, dirname, basename)
docstring: TODO: Add update on individual dir divs. 
          update = {
              "search_type": search_type, 
              #"search_key": parent_sk,
              #"compare": "@COUNT(@SOBJECT(sthpw/file['relative_dir', 'like', '%%%s%%'])) > 0" % relative_dir,
              "cbjs_action": '''console.log("hi");'''
          }
          item_div.add_update(update)
docstring_summary: TODO: Add update on individual dir divs. 
          update = {
              "search_type": search_type, 
              #"search_key": parent_sk,
              #"compare": "
docstring_tokens: TODO : Add update on individual dir divs . update = { search_type : search_type # search_key : parent_sk # compare :
function: def add_dir_behaviors(self, item_div, dirname, basename):
          
          parent_key = self.kwargs.get("parent_key")
  
          if self.file_system_edit == True:
               
              
              """
              This will not work because dir and items already have a mouseenter and mouseleave. 
              
              item_div.add_attr("ondragenter", "spt.repo_browser.drag_enter(event, this);")
              item_div.add_attr("ondragleave", "spt.repo_browser.drag_leave(event, this)")
              item_div.add_attr("ondragover", "console.log('hi');" 
              item_div.add_attr("ondrop", "spt.repo_browser.drag_drop(event, this)")
              """
  
              item_div.add_class("DROP_ROW")
              item_div.add_class("spt_drop_handler")
              item_div.add_attr("spt_drop_handler", "spt.repo_browser.drag_drop")
              
              item_div.add_behavior( {
                  'type': 'drag',
                  "mouse_btn": 'LMB',
                  "drag_el": '@',
                  "cb_set_prefix": 'spt.repo_browser.drag_file'
              } ) 
  
          SmartMenu.assign_as_local_activator( item_div, 'DIR_ITEM_CTX' )
  
          asset_base_dir = Environment.get_asset_dir()
  
          path = "%s/%s" % (dirname, basename)
  
          relative_dir = path.replace(asset_base_dir, "")
          relative_dir = relative_dir.strip("/")
  
  
          search_codes = self.search_codes
  
          search_types = self.search_types_dict
          search_type = search_types.get("%s/" % path)
  
          if not search_type:
              parts = relative_dir.split("/")
              for i in range(len(parts)+1, 0, -1):
                  tmp_rel_dir = "/".join(parts[:i])
                  tmp_dir = "%s/%s" % (self.base_dir, tmp_rel_dir)
                  search_type = search_types.get("%s/" % tmp_dir)
                  if search_type:
                      break
  
          if not search_type and search_types:
              search_type = search_types[list(search_types.keys())[0]]
  
          if not search_type and self.search_types:
              search_type = self.search_types[0]
  
          item_div.add_attr("spt_search_type", search_type)
          item_div.add_attr("spt_relative_dir", relative_dir)
          item_div.add_attr("spt_dirname", "%s/%s" % (dirname, basename))
  
          """
          TODO: Add update on individual dir divs. 
          update = {
              "search_type": search_type, 
              #"search_key": parent_sk,
              #"compare": "@COUNT(@SOBJECT(sthpw/file['relative_dir', 'like', '%%%s%%'])) > 0" % relative_dir,
              "cbjs_action": '''console.log("hi");'''
          }
          item_div.add_update(update)
          """
function_tokens: def add_dir_behaviors ( self , item_div , dirname , basename ) : parent_key = self . kwargs . get ( "parent_key" ) if self . file_system_edit == True : """
              This will not work because dir and items already have a mouseenter and mouseleave. 
              
              item_div.add_attr("ondragenter", "spt.repo_browser.drag_enter(event, this);")
              item_div.add_attr("ondragleave", "spt.repo_browser.drag_leave(event, this)")
              item_div.add_attr("ondragover", "console.log('hi');" 
              item_div.add_attr("ondrop", "spt.repo_browser.drag_drop(event, this)")
              """ item_div . add_class ( "DROP_ROW" ) item_div . add_class ( "spt_drop_handler" ) item_div . add_attr ( "spt_drop_handler" , "spt.repo_browser.drag_drop" ) item_div . add_behavior ( { 'type' : 'drag' , "mouse_btn" : 'LMB' , "drag_el" : '@' , "cb_set_prefix" : 'spt.repo_browser.drag_file' } ) SmartMenu . assign_as_local_activator ( item_div , 'DIR_ITEM_CTX' ) asset_base_dir = Environment . get_asset_dir ( ) path = "%s/%s" % ( dirname , basename ) relative_dir = path . replace ( asset_base_dir , "" ) relative_dir = relative_dir . strip ( "/" ) search_codes = self . search_codes search_types = self . search_types_dict search_type = search_types . get ( "%s/" % path ) if not search_type : parts = relative_dir . split ( "/" ) for i in range ( len ( parts ) + 1 , 0 , - 1 ) : tmp_rel_dir = "/" . join ( parts [ : i ] ) tmp_dir = "%s/%s" % ( self . base_dir , tmp_rel_dir ) search_type = search_types . get ( "%s/" % tmp_dir ) if search_type : break if not search_type and search_types : search_type = search_types [ list ( search_types . keys ( ) ) [ 0 ] ] if not search_type and self . search_types : search_type = self . search_types [ 0 ] item_div . add_attr ( "spt_search_type" , search_type ) item_div . add_attr ( "spt_relative_dir" , relative_dir ) item_div . add_attr ( "spt_dirname" , "%s/%s" % ( dirname , basename ) )