Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Martin Markech
refinerycms-photo-gallery
Commits
8924515e
Commit
8924515e
authored
Sep 22, 2012
by
Martin Markech
Browse files
ajaxified pagination for fancybox 1.3
parent
8149412f
Changes
2
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
8924515e
...
...
@@ -154,6 +154,30 @@ in your app, override it using rake refinery:override command and add this line
<
/script>
```
If you want to use Fancybox 1.3, use this javascipt to initialize:
```
javascript
<
script
type
=
"
text/javascript
"
>
$
(
document
).
ready
(
function
()
{
var
load_fancybox
=
function
loadFancybox
()
{
$
(
"
a[rel=group]
"
).
fancybox
({
'
transitionIn
'
:
'
none
'
,
'
transitionOut
'
:
'
none
'
,
'
titlePosition
'
:
'
over
'
,
'
titleFormat
'
:
function
(
title
,
currentArray
,
currentIndex
,
currentOpts
)
{
return
'
<span id="fancybox-title-over">Image
'
+
(
currentIndex
+
1
)
+
'
/
'
+
currentArray
.
length
+
(
title
.
length
?
'
'
+
title
:
''
)
+
'
</span>
'
;
}
});
};
load_fancybox
();
$
(
"
#photo_gallery
"
).
on
(
"
gallery_loaded
"
,
function
()
{
load_fancybox
();
});
});
<
/script>
```
Before production, don't forget to precompile assets by:
```
ruby
...
...
app/views/refinery/photo_gallery/albums/_photos.js.erb
View file @
8924515e
$(document).ready(function(){
$('#photo_gallery').html("
<%=
escape_javascript
(
render
:partial
=>
"refinery/photo_gallery/albums/photos"
,
:formats
=>
[
:html
]
)
%>
");
// Needed for Fancybox 1.3.4. Fancybox v2 can handle ajax content replacement
$('#photo_gallery').trigger('gallery_loaded');
});
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment