blacklight 5.0.1 → 5.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/VERSION +1 -1
- data/app/assets/javascripts/blacklight/ajax_modal.js +18 -9
- data/app/assets/javascripts/blacklight/core.js +6 -5
- data/app/views/shared/_header_navbar.html.erb +1 -1
- data/lib/blacklight/utils.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 39a6ce9d4e75308e52d555bfc2a9142e4a3e323c
|
4
|
+
data.tar.gz: 98fed869e782531d52fd52ba807411ad8c200f59
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8008cc989c982ebb220ae69d01e39070c7b07078ed18bccceb3b64af6c8963eafd7a7e5023cb8925c6cf9da4d8bd1f438fe5f12813835c2c2a56760bcdb16851
|
7
|
+
data.tar.gz: 05e632077c43895265057e9da360862554d69386f42f90d17faee1130877f63e939ee7db9e4fe4cf461dd2d9a5883b9e4b42c2727f5ad8ccaa8e528ec4b991b2
|
data/.travis.yml
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
5.0.
|
1
|
+
5.0.2
|
@@ -83,12 +83,20 @@ if (Blacklight.ajaxModal === undefined) {
|
|
83
83
|
// a Bootstrap modal div that should be already on the page hidden
|
84
84
|
Blacklight.ajaxModal.modalSelector = "#ajax-modal";
|
85
85
|
|
86
|
+
// Trigger selectors identify forms or hyperlinks that should open
|
87
|
+
// inside a modal dialog.
|
86
88
|
Blacklight.ajaxModal.triggerLinkSelector = "a[data-ajax-modal~=trigger], a.lightboxLink,a.more_facets_link,.ajax_modal_launch";
|
87
89
|
Blacklight.ajaxModal.triggerFormSelector = "form[data-ajax-modal~=trigger], form.ajax_form";
|
88
90
|
|
89
|
-
// preserve selectors
|
90
|
-
|
91
|
-
|
91
|
+
// preserve selectors identify forms or hyperlinks that, if activated already
|
92
|
+
// inside a modal dialog, should have destinations remain inside the modal -- but
|
93
|
+
// won't trigger a modal if not already in one.
|
94
|
+
//
|
95
|
+
// No need to repeat selectors from trigger selectors, those will already
|
96
|
+
// be preserved. MUST be manually prefixed with the modal selector,
|
97
|
+
// so they only apply to things inside a modal.
|
98
|
+
Blacklight.ajaxModal.preserveLinkSelector = Blacklight.ajaxModal.modalSelector + ' a[data-ajax-modal~=preserve]';
|
99
|
+
Blacklight.ajaxModal.preserveFormSelector = Blacklight.ajaxModal.modalSelector + 'form[data-ajax-modal~=preserve]'
|
92
100
|
|
93
101
|
Blacklight.ajaxModal.containerSelector = "[data-ajax-modal~=container]";
|
94
102
|
|
@@ -152,12 +160,13 @@ Blacklight.ajaxModal.setup_modal = function() {
|
|
152
160
|
$("body").trigger(e);
|
153
161
|
if (e.isDefaultPrevented()) return;
|
154
162
|
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
$("body").on("submit", Blacklight.ajaxModal.
|
163
|
+
// Register both trigger and preserve selectors in ONE event handler, combining
|
164
|
+
// into one selector with a comma, so if something matches BOTH selectors, it
|
165
|
+
// still only gets the event handler called once.
|
166
|
+
$("body").on("click", Blacklight.ajaxModal.triggerLinkSelector + ", " + Blacklight.ajaxModal.preserveLinkSelector,
|
167
|
+
Blacklight.ajaxModal.modalAjaxLinkClick);
|
168
|
+
$("body").on("submit", Blacklight.ajaxModal.triggerFormSelector + ", " + Blacklight.ajaxModal.preserveFormSelector,
|
169
|
+
Blacklight.ajaxModal.modalAjaxFormSubmit);
|
161
170
|
|
162
171
|
// Catch our own custom loaded event to implement data-ajax-modal=closed
|
163
172
|
$("body").on("loaded.blacklight.ajax-modal", Blacklight.ajaxModal.check_close_ajax_modal);
|
@@ -13,11 +13,12 @@ Blacklight = function() {
|
|
13
13
|
}
|
14
14
|
}();
|
15
15
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
}
|
16
|
+
// turbolinks triggers page:load events on page transition
|
17
|
+
// If app isn't using turbolinks, this event will never be triggered, no prob.
|
18
|
+
$(document).on('page:load', function() {
|
19
|
+
Blacklight.activate();
|
20
|
+
});
|
21
|
+
|
21
22
|
$(document).ready(function() {
|
22
23
|
Blacklight.activate();
|
23
24
|
});
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<div id="header-navbar" class="navbar navbar-
|
1
|
+
<div id="header-navbar" class="navbar navbar-inverse navbar-static-top" role="navigation">
|
2
2
|
<div class="container">
|
3
3
|
<div class="navbar-header">
|
4
4
|
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#user-util-collapse">
|
data/lib/blacklight/utils.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'ostruct'
|
2
2
|
module Blacklight
|
3
3
|
class OpenStructWithHashAccess < OpenStruct
|
4
|
-
delegate :keys, :each, :map, :has_key?, :delete, :length, :reject!, :select!, :include, :fetch, :to => :to_h
|
4
|
+
delegate :keys, :each, :map, :has_key?, :empty?, :delete, :length, :reject!, :select!, :include, :fetch, :to => :to_h
|
5
5
|
|
6
6
|
def []=(key, value)
|
7
7
|
send "#{key}=", value
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blacklight
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0.
|
4
|
+
version: 5.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Rochkind
|
@@ -17,7 +17,7 @@ authors:
|
|
17
17
|
autorequire:
|
18
18
|
bindir: bin
|
19
19
|
cert_chain: []
|
20
|
-
date: 2014-02-
|
20
|
+
date: 2014-02-13 00:00:00.000000000 Z
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
23
23
|
name: rails
|