Skip to content
Extraits de code Groupes Projets
Valider 19e8aa5c rédigé par Raphael's avatar Raphael
Parcourir les fichiers

Refactored view js

parent a42c8da1
Branches
Étiquettes
Aucune requête de fusion associée trouvée
- content_for :head do
:javascript
$(document).ready(function(){
$("#add_album_button").fancybox();
});
.back= link_to "⇧ home", root_path .back= link_to "⇧ home", root_path
%h1.big_text %h1.big_text
Albums Albums
......
- content_for :head do - content_for :head do
:javascript = javascript_include_tag 'photos', 'jquery.html5_upload'
$(document).ready(function(){
reset_photo_fancybox();
});
.album_id{:id => @album.id, :style => "display:hidden;"} .album_id{:id => @album.id, :style => "display:hidden;"}
.back= link_to '⇧ albums', albums_path .back= link_to '⇧ albums', albums_path
......
...@@ -23,8 +23,6 @@ ...@@ -23,8 +23,6 @@
= csrf_meta_tag = csrf_meta_tag
= yield(:head) = yield(:head)
= javascript_include_tag 'jquery.html5_upload'
%body %body
- flash.each do |name, msg| - flash.each do |name, msg|
= content_tag :div, msg, :id => "flash_#{name}" = content_tag :div, msg, :id => "flash_#{name}"
......
$(document).ready(function(){
reset_photo_fancybox();
$("#add_photo_button").fancybox({
'onClosed' : function(){
if($("#add_photo_button").hasClass("uploading_complete")){
$("#add_photo_button").removeClass("uploading_complete");
reset_photo_fancybox();
}
}
});
$(".image_thumb img").load( function() {
$(this).fadeIn("slow");
});
});//end document ready
function reset_photo_fancybox(){
album_id = $(".album_id")[0].id;
ajax = $.get("/photos/new?album_id=" + album_id, function(){
$("#new_photo_pane").html(ajax.responseText)
});
}
...@@ -20,25 +20,16 @@ $(document).ready(function(){ ...@@ -20,25 +20,16 @@ $(document).ready(function(){
//buttons////// //buttons//////
$("#add_album_button").fancybox();
$("#add_group_button").fancybox(); $("#add_group_button").fancybox();
$("#add_request_button").fancybox({ 'titleShow': false }); $("#add_request_button").fancybox({ 'titleShow': false });
$("#add_photo_button").fancybox({
'onClosed' : function(){
if($("#add_photo_button").hasClass("uploading_complete")){
$("#add_photo_button").removeClass("uploading_complete");
reset_photo_fancybox();
}
}
});
//pane_toggler_button("photo"); //pane_toggler_button("photo");
$("input[type='submit']").addClass("button"); $("input[type='submit']").addClass("button");
$(".image_thumb img").load( function() {
$(this).fadeIn("slow");
});
$(".image_cycle img").load( function() { $(".image_cycle img").load( function() {
$(this).fadeIn("slow"); $(this).fadeIn("slow");
...@@ -48,12 +39,7 @@ $(document).ready(function(){ ...@@ -48,12 +39,7 @@ $(document).ready(function(){
});//end document ready });//end document ready
function reset_photo_fancybox(){
album_id = $(".album_id")[0].id;
ajax = $.get("/photos/new?album_id=" + album_id, function(){
$("#new_photo_pane").html(ajax.responseText)
});
}
function pane_toggler_button( name ) { function pane_toggler_button( name ) {
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter