Handle per page changing
553126
function handlePerPage() {
      //* if there's a custom dropdown then we use that
      if (this.customRowsPerPageDropdown !== null && Array.isArray(this.customRowsPerPageDropdown) && this.customRowsPerPageDropdown.length !== 0) {
        this.rowsPerPageOptions = this.customRowsPerPageDropdown;
      } else {
        //* otherwise we use the default rows per page dropdown
        this.rowsPerPageOptions = cloneDeep(DEFAULT_ROWS_PER_PAGE_DROPDOWN);
      }

      if (this.perPage) {
        this.currentPerPage = this.perPage; // if perPage doesn't already exist, we add it

        var found = false;

        for (var i = 0; i < this.rowsPerPageOptions.length; i++) {
          if (this.rowsPerPageOptions[i] === this.perPage) {
            found = true;
          }
        }

        if (!found && this.perPage !== -1) {
          this.rowsPerPageOptions.unshift(this.perPage);
        }
      } else {
        // reset to default
        this.currentPerPage = 10;
      }
    }
1006489
function handlePageClick(originalEvent) {
    const target = originalEvent.target;
    emitAndFire(this, 'pagination-select', {
        originalEvent,
        el: target,
        value: target.innerText
    });
}
1279594
function (e) {
        var v = e.newValue,rpp,state;
        if (e.prevValue !== v) {
            if (v !== Paginator.VALUE_UNLIMITED) {
                rpp = this.get('rowsPerPage');

                if (rpp && this.get('recordOffset') >= v) {
                    state = this.getState({
                        totalRecords : e.prevValue,
                        recordOffset : this.get('recordOffset')
                    });

                    this.set('recordOffset', state.before.recordOffset);
                    this._firePageChange(state);
                }
            }
        }
    }
483811
function _handleExternalChange(evt, doc) {
        if (doc) {
            _removeBackwardFramesForFile(doc.file);
            _removeForwardFramesForFile(doc.file);
            _validateNavigationCmds();
        }
    }
1043128
function(client, initialData, totalLength, requestOptions, successStatuses, successRootKeys, promise) {
    this.currentPage = 1; // default to start at page 1
    // this.perPage = queryParams && queryParams.per_page || 25; // default to 25 per page
    this.totalLength = totalLength;
    // bootstrap with initial data
    this.push.apply(this, initialData);

    this.client = client;
    this.requestOptions = requestOptions;
    this.successStatuses = successStatuses;
    this.successRootKeys = successRootKeys;
    this.promise = promise;
  }
171268
private function treatmentPerPage()
    {
        if ($this->getPP !== null && (preg_match(self::REGEX_INTEGER, $this->getPP) || $this->getPP == self::ALL)) {
            if (in_array($this->getPP, $this->arrayOptionsSelect)) {
                if ($this->getPP == self::ALL) {
                    $this->perPage = null;
                    $this->getP = 1;
                } else {
                    $this->perPage = (int) round($this->getPP);
                }
            } else {
                $this->perPage = $this->defaultPerPage;
            }
        } else {
            $this->perPage = $this->defaultPerPage;
        }
    }
1008383
public function page ($page, $per_page = null)
	{
		$model = $this->model;

		if($per_page === null) { $per_page = $model::$per_page; }

		$this->offset($page * $per_page)->limit($per_page);

		return $this;
	}
1348588
function( to, from, prefix ) {
            var samePage = false;

            prefix = prefix || "";

            // TODO decide if these events should in fact be triggered on the container
            if ( from ) {

                //Check if this is a same page transition and tell the handler in page
                if( to[0] === from[0] ){
                    samePage = true;
                }

                //trigger before show/hide events
                // TODO deprecate nextPage in favor of next
                this._triggerWithDeprecated( prefix + "hide", {

                    // Deprecated in 1.4 remove in 1.5
                    nextPage: to,
                    toPage: to,
                    prevPage: from,
                    samePage: samePage
                }, from );
            }

            // TODO deprecate prevPage in favor of previous
            this._triggerWithDeprecated( prefix + "show", {
                prevPage: from || $( "" ),
                toPage: to
            }, to );
        }
370737
function reanderPage(Handler, data) {
    React.render(React.createElement(Handler, { data: data }), document);
}
773463
def each_page
      page_obj = load_page(1)
      loop do
        yield page_obj
        break unless page_obj.has_next?
        page_obj = load_page(page_obj.next_page)
      end
    end
1049180
function (name, data) {
            switch (name) {
                case 'ready':
                    // $pages won't be available until the 'ready' message is broadcas
                    var viewerConfig = scope.getConfig();
                    $pages = viewerConfig.$pages;
                    $viewport = viewerConfig.$viewport;
                    $viewport.on('mousedown', handleMousedown);
                    break;
                case 'pageload':
                    if ($pages.eq(data.page - 1).find('.page-content').length === 0) {
                        insertContent(data.page);
                    }
                    break;
            }
        }
1343823
private void setCurrentPage(int page) {
        if (page >= totalPages) {
            this.currentPage = totalPages;
        } else if (page <= 1) {
            this.currentPage = 1;
        } else {
            this.currentPage = page;
        }

        // now work out where the sub-list should start and end
        startingIndex = pageSize * (currentPage -1);
        if (startingIndex < 0) {
            startingIndex = 0;
        }
        endingIndex = startingIndex + pageSize;
        if (endingIndex > list.size()) {
            endingIndex = list.size();
        }
    }
118308
def page_to_offset(params):
    

    if 'page' not in params:
        return

    page = params['page']
    del params['page']

    # 'per_page' je len alias za 'limit'
    if 'per_page' in params:
        per_page = params.get('per_page')
        del params['per_page']
    else:
        per_page = params.get('limit', 10)

    params['offset'] = int(per_page) * (int(page) - 1)
    params['limit'] = per_page
1298948
private function setPerPage()
    {
        if ($this->hasInput('per_page'))
        {
            $per_page_input = $this->getInput('per_page');

            if ($this->isValidPageNumber($per_page_input)) {
                $this->perPage = $per_page_input;
            }
            else if ($per_page_input == 'all')
            {
                $this->perPage = 'all';
            }
        }
    }
676584
function (page) {
            var state = this.state;
            if (state.currentPage !== page) {
                // page has changed
                state.currentPage = page;
                this.updateVisiblePages();
                scope.broadcast('pagefocus', {
                    page: state.currentPage,
                    numPages: this.numPages,
                    visiblePages: util.extend([], state.visiblePages),
                    fullyVisiblePages: util.extend([], state.fullyVisiblePages)
                });
            } else {
                // still update visible pages!
                this.updateVisiblePages();
            }
        }
802211
function pageInfoFromParent() {
        var msgBody = getData()
        log('PageInfoFromParent called from parent: ' + msgBody)
        onPageInfo(JSON.parse(msgBody))
        log(' --')
      }
77236
function (e) {
        if (!this.all || (e && e.prevValue === e.newValue)) {
            return;
        }

        this.all.value = e.newValue;
        if (this.all.selected) {
            this.paginator.set('rowsPerPage',e.newValue);
        }
    }