Moves a block. If the target block is not provided, the block is only moved within its
current parent ID and placeholder.
15009
public function moveBlock(Block $block, Block $targetBlock, string $placeholder, int $position): void
    {
        $query = $this->connection->createQueryBuilder();

        $query
            ->update('ngbm_block')
            ->set('position', ':position')
            ->set('parent_id', ':parent_id')
            ->set('placeholder', ':placeholder')
            ->where(
                $query->expr()->eq('id', ':id')
            )
            ->setParameter('id', $block->id, Type::INTEGER)
            ->setParameter('position', $position, Type::INTEGER)
            ->setParameter('parent_id', $targetBlock->id, Type::INTEGER)
            ->setParameter('placeholder', $placeholder, Type::STRING);

        $this->applyStatusCondition($query, $block->status);

        $query->execute();

        $depthDifference = $block->depth - ($targetBlock->depth + 1);

        $query = $this->connection->createQueryBuilder();

        $query
            ->update('ngbm_block')
            ->set('layout_id', ':layout_id')
            ->set('depth', 'depth - :depth_difference')
            ->set('path', 'replace(path, :old_path, :new_path)')
            ->where(
                $query->expr()->like('path', ':path')
            )
            ->setParameter('layout_id', $targetBlock->layoutId, Type::INTEGER)
            ->setParameter('depth_difference', $depthDifference, Type::INTEGER)
            ->setParameter('old_path', $block->path, Type::STRING)
            ->setParameter('new_path', $targetBlock->path . $block->id . '/', Type::STRING)
            ->setParameter('path', $block->path . '%', Type::STRING);

        $this->applyStatusCondition($query, $block->status);

        $query->execute();
    }
337277
public void updateToRemovedBlock(boolean add, long blockId) {
    if (add) {
      if (mBlocks.contains(blockId)) {
        mToRemoveBlocks.add(blockId);
      }
    } else {
      mToRemoveBlocks.remove(blockId);
    }
  }
930124
function(e){
	    // Check if we are talking about self or parent.
	    if( this === e.target ||
		container_id === jQuery(e.target).parent().attr('id') ||
		container_id === jQuery(e.target).attr('id') ){
    		_update_start_pos(e);
    		// Bind to moving.
    		jQuery(container_div).bind('mousemove', _scroller);
	    }
    	}
70570
void insertIntoList(BlockInfo head, int headIndex, BlockInfo tail, int tailIndex, int count) {
    if (head == null)
      return;
    
    // connect tail to now-head
    tail.setNext(tailIndex, blockList);
    if (blockList != null)
      blockList.setPrevious(blockList.findDatanode(this), tail);
    
    // create new head
    blockList = head;
    blockList.setPrevious(headIndex, null);
    
    // add new blocks to the count
    numOfBlocks += count;
  }
1078073
public function setBlock($block)
    {
        if (!empty($block) && $block <= 4 && $block !== 0 && !($block < 0)) {
            $this->block = $block;
        }
    }
1219504
def move_after(self, node_id):
          # noqa
        session = Session.object_session(self)
        self.parent_id = self.parent_id
        self.mptt_move_after = node_id
        session.add(self)
701180
function() {
        if (!this.blocks) {
            this.createBlocks();
        }
        
        if (this.size && this.relativePosition) {
            var position = this.positionBlocks[this.relativePosition];
            for (var i = 0; i < position.blocks.length; i++) {
    
                var positionBlock = position.blocks[i];
                var block = this.blocks[i];
    
                // adjust sizes
                var l = positionBlock.anchor.left;
                var b = positionBlock.anchor.bottom;
                var r = positionBlock.anchor.right;
                var t = positionBlock.anchor.top;
    
                //note that we use the isNaN() test here because if the 
                // size object is initialized with a "auto" parameter, the 
                // size constructor calls parseFloat() on the string, 
                // which will turn it into NaN
                //
                var w = (isNaN(positionBlock.size.w)) ? this.size.w - (r + l) 
                                                      : positionBlock.size.w;
    
                var h = (isNaN(positionBlock.size.h)) ? this.size.h - (b + t) 
                                                      : positionBlock.size.h;
    
                block.div.style.width = (w < 0 ? 0 : w) + 'px';
                block.div.style.height = (h < 0 ? 0 : h) + 'px';
    
                block.div.style.left = (l != null) ? l + 'px' : '';
                block.div.style.bottom = (b != null) ? b + 'px' : '';
                block.div.style.right = (r != null) ? r + 'px' : '';            
                block.div.style.top = (t != null) ? t + 'px' : '';
    
                block.image.style.left = positionBlock.position.x + 'px';
                block.image.style.top = positionBlock.position.y + 'px';
            }
    
            this.contentDiv.style.left = this.padding.left + "px";
            this.contentDiv.style.top = this.padding.top + "px";
        }
    }
1009849
protected function block(OutputBlock $block)
    {
        if (empty($block->lines) && empty($block->children)) {
            return;
        }

        $this->currentBlock = $block;

        $pre = $this->indentStr();

        if (! empty($block->selectors)) {
            $this->blockSelectors($block);

            $this->indentLevel++;
        }

        if (! empty($block->lines)) {
            $this->blockLines($block);
        }

        if (! empty($block->children)) {
            $this->blockChildren($block);
        }

        if (! empty($block->selectors)) {
            $this->indentLevel--;

            if (empty($block->children)) {
                $this->write($this->break);
            }

            $this->write($pre . $this->close . $this->break);
        }
    }
852280
public void setBlocks(java.util.Collection<Block> blocks) {
        if (blocks == null) {
            this.blocks = null;
            return;
        }

        this.blocks = new java.util.ArrayList<Block>(blocks);
    }
614946
private void moveTo(long blkNum, int slot) {
		moveFrom = currentPage.currentBlk().number(); // for deletion
		BlockId blk = new BlockId(currentPage.currentBlk().fileName(), blkNum);
		ccMgr.readLeafBlock(blk);
		currentPage.close();
		currentPage = new BTreePage(blk, NUM_FLAGS, schema, tx);
		currentSlot = slot;
	}
1355403
function() {
            if (!this.parent) {
                Kinetic.Util.warn('Node has no parent. moveToTop function is ignored.');
                return;
            }
            var index = this.index;
            this.parent.children.splice(index, 1);
            this.parent.children.push(this);
            this.parent._setChildrenIndices();
            return true;
        }
629086
public function moveToNewParent()
	{
		$pid = static::$moveToNewParentId;

		if ( is_null( $pid ) )
			$this->makeRoot();
		else if ( $pid !== false )
			$this->makeChildOf( $pid );
	}
369492
def goto_block(self, block):
        
        old_block = self.basic_block
        term = block.terminator
        if term is not None:
            self.position_before(term)
        else:
            self.position_at_end(block)
        try:
            yield
        finally:
            self.position_at_end(old_block)
197351
@Override
    protected void afterMoveChild(ElementBase child, ElementBase before) {
        ElementTreePane childpane = (ElementTreePane) child;
        ElementTreePane beforepane = (ElementTreePane) before;
        moveChild(childpane.getNode(), beforepane.getNode());
    }
758534
private <T extends Block> void addBlock(Block currentBlock, List<T> blocks)
    {
        if (currentBlock != null && this.matcher.match(currentBlock)) {
            blocks.add((T) currentBlock);
        }
    }
630321
public void moveToBack(Object parent, String name) {
		Element parentElement = getGroup(parent);
		if (parentElement == null) {
			throw new IllegalArgumentException("moveToBack failed: could not find parent group.");
		}

		Element element = getElement(parent, name);
		if (element == null) {
			throw new IllegalArgumentException("moveToBack failed: could not find element within group.");
		}

		if (parentElement.getFirstChildElement() != element) {
			parentElement.insertFirst(element);
		}
	}
215768
def reapply(&block)
      raise ArgumentError.new('Block required') unless block
      raise InvalidDeferredError.new('reapply must be run inside of a context') unless @context

      if reapply?
        yield
      end

      block = block.weak!
      parent_layout.reapply_blocks << [@context, block]
      return self
    end