
Security News
rv Is a New Rust-Powered Ruby Version Manager Inspired by Python's uv
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Essa GEM fornece a possibilidade de navegação de paǵinas sobrepostas, facilitando assim a abertura de novas páginas em perder o conteúdo anterior.
Adicione essa linha no Gemfile do projeto:
gem 'page_stack'
Instale a gem utilizando o comando abaixo no diretório raiz da aplicação:
$ bundle install
Adicione no seu arquivo application_controller.rb
a seguinte configuração:
class ApplicationController < ActionController::Base
include PageStack
layout :pagestack_layout
end
Adicione a seguinte linha no seu arquivo application.css
:
*= require pagestack
Adicione a seguinte linha no seu arquivo application.js
:
//= require pagestack
//= require jquery.remotipart
Para inicializar o plugin você utilizará o código abaixo:
var pagestack = new PageStack().init();
Seus eventos são baseados em delegator do jQuery e estão vinculados ao document.
Você possui três parâmetros de configuração para o pagestack:
var pagestack = new PageStack({
form: 'form',
loading: true,
closeOnEsc: false,
debug: false
}).init();
Você pode abrir multiplas páginas sobrepostas apenas configurando os links em cada página.
Para indicar que um link abrirá uma pagestack adicione a classe pagestack
ao seu elemento:
= link_to "Abrir Página", root_path, class: 'pagestack'
Para indicar o título da nova página utilize o atributo data pagestack-title
:
= link_to "Abrir Página", root_path, class: 'pagestack', data: {'pagestack-title' => 'Título da minha página sobreposta'}
Caso você abra uma sub-página sobreposta e precise que ao fechar essa página você recarregue o conteúdo da página origem você precisa indicar o atributo data pagestack-refresh-parent-onclose
:
= link_to "Abrir Página", root_path, class: 'pagestack', data: {'pagestack-refresh-parent-onclose' => true}
Caso você precise alterar o conteúdo da própria pagestack (self) ao invés de abrir uma nova você pode informar o atributo data-pagestack-replace-content
:
= link_to "Abrir Página", root_path, class: 'pagestack', data: {'pagestack-refresh-replace-content' => true}
Para ativar/desativar o fechamento do pagestack ativo através da tecla ESC utilize o atributo data-pagestack-close-esc
. O padrão é false:
= link_to "Abrir Página", root_path, class: 'pagestack', data: {'pagestack-esc-close' => 'true'}
= link_to "Abrir Página", root_path, class: 'pagestack', data: {'pagestack-esc-close' => 'false'}
Ao iniciar o plugin você recebe o retorno e pode atribuir a uma variável (Ex: var pagestack
no código de instalação):
var pagestack = PageStack().init();
var current_page = pagestack.getItem(elemento_dentro_do_pagestack);
pagestack.close(elemento_dentro_do_pagestack);
Formulário
Links
FAQs
Unknown package
We found that page_stack demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.