Socket
Book a DemoInstallSign in
Socket

rails_dialog

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rails_dialog

0.0.2
bundlerRubygems
Version published
Maintainers
1
Created
Source

rails_dialog

rails_dialog is sass mixin for rails to implement a dialog easily. This gem is based on sass-dialog.

Demonstration

You can try how this works here.
(This demonstration is based on sass-dialog version, but works in the same way.)

Instration

Put these lines in your Gemfile and run the bundle command to install.

gem 'sass-rails'
gem 'compass-rails'
gem 'rails_dialog'

Import rails_dialog. (This is example of application.css.scss)

@import 'compass';
@import 'rails_dialog';

Usage

####HTML

Write nested div tags to express a dialog. Outer one needs a id attribute and a class attribute. In addition, link or button to show dialog is necessary.

<div id="dialog" class="dialog">
  <div>
    <!-- Content in dialog -->
    <h2>Dialog</h2>
    <div>
      <a href="javascript:void(0);" id="hide-link">Hide Dialog</a>
    </div>
  </div>
</div>

<a href="javascript:void(0);" id="show-link">Show Dialog</a>

Sass

Include dialog mixin. You have to specify width and height of dialog as parameters.

.dialog {
  @include dialog(700px, 400px);
}

Coffeescript

Javascript shows and hides the dialog.

$ ->
  $('#show-link').click ->
    $('#dialog').show()

  $('#hide-link').click ->
    $('#dialog').hide()

FAQs

Package last updated on 25 Oct 2014

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.