B2G/gecko/browser/components/places/content/controller.js
/**
   * Determines if a container node can be moved.
   *
   * @param   aId
   *          A bookmark folder id.
   * @param   [optional] aParentId
   *          The parent id of the folder.
   * @returns True if the container can be moved to the target.
   */
Determines if a container node can be moved.
@param   aId
A bookmark folder id.
@param   [optional] aParentId
The parent id of the folder.
@returns True if the container can be moved to the target.
Determines if a container node can be moved . @param aId A bookmark folder id . @param [ optional ] aParentId The parent id of the folder . @returns True if the container can be moved to the target .
function PCDH_canMoveContainer(aId, aParentId) {
    if (aId == -1)
      return false;
    const ROOTS = [PlacesUtils.placesRootId, PlacesUtils.bookmarksMenuFolderId,
                   PlacesUtils.tagsFolderId, PlacesUtils.unfiledBookmarksFolderId,
                   PlacesUtils.toolbarFolderId];
    if (ROOTS.indexOf(aId) != -1)
      return false;
    if (aParentId == null || aParentId == -1)
      aParentId = PlacesUtils.bookmarks.getFolderIdForItem(aId);
    if (PlacesUtils.bookmarks.getFolderReadonly(aParentId))
      return false;
    return true;
  }
function PCDH_canMoveContainer ( aId , aParentId ) { if ( aId == - 1 ) return false ; const ROOTS = [ PlacesUtils . placesRootId , PlacesUtils . bookmarksMenuFolderId , PlacesUtils . tagsFolderId , PlacesUtils . unfiledBookmarksFolderId , PlacesUtils . toolbarFolderId ] ; if ( ROOTS . indexOf ( aId ) != - 1 ) return false ; if ( aParentId == null || aParentId == - 1 ) aParentId = PlacesUtils . bookmarks . getFolderIdForItem ( aId ) ; if ( PlacesUtils . bookmarks . getFolderReadonly ( aParentId ) ) return false ; return true ; }
Determines if a container node can be moved.
Determines if a container node can be moved .
// Disallow moving of roots and special folders. // Get parent id if necessary.