Skip to content
Extraits de code Groupes Projets
Valider cdc29e44 rédigé par Jonne Haß's avatar Jonne Haß
Parcourir les fichiers

Move facebox configuration into the initialization of the Backbone app

Facebox is already called from some Backbone views very early, making its icons 404 otherwise.
parent 3627f46b
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
* Fix pagination for people list on the tag stream page [#4245](https://github.com/diaspora/diaspora/pull/4245) * Fix pagination for people list on the tag stream page [#4245](https://github.com/diaspora/diaspora/pull/4245)
* Fix missing timeago tooltip in conversations [#4257](https://github.com/diaspora/diaspora/issues/4257) * Fix missing timeago tooltip in conversations [#4257](https://github.com/diaspora/diaspora/issues/4257)
* Fix link to background image [#4289](https://github.com/diaspora/diaspora/pull/4289) * Fix link to background image [#4289](https://github.com/diaspora/diaspora/pull/4289)
* Fix Facebox icons 404s when called from Backbone
## Features ## Features
* Admin: add option to find users under 13 (COPPA) [#4252](https://github.com/diaspora/diaspora/pull/4252) * Admin: add option to find users under 13 (COPPA) [#4252](https://github.com/diaspora/diaspora/pull/4252)
......
...@@ -40,25 +40,17 @@ var app = { ...@@ -40,25 +40,17 @@ var app = {
app.currentUser = app.user(window.gon.user) || new app.models.User(); app.currentUser = app.user(window.gon.user) || new app.models.User();
if(app.currentUser.authenticated()){ this.setupFacebox();
this.setupHovercards();
if(app.currentUser.authenticated()) {
app.header = new app.views.Header(); app.header = new app.views.Header();
$("header").prepend(app.header.el); $("header").prepend(app.header.el);
app.header.render(); app.header.render();
} }
Backbone.history.start({pushState: true}); Backbone.history.start({pushState: true});
// there's probably a better way to do this...
$("a[rel=backbone]").live("click", function(evt){
evt.preventDefault();
var link = $(this);
$(".stream_title").text(link.text())
app.router.navigate(link.attr("href").substring(1) ,true)
});
app.hovercard = new app.views.Hovercard();
app.aspectMemberships = new app.views.AspectMembership(); app.aspectMemberships = new app.views.AspectMembership();
}, },
...@@ -80,6 +72,25 @@ var app = { ...@@ -80,6 +72,25 @@ var app = {
return(preload) return(preload)
}, },
setupFacebox: function() {
$.facebox.settings.closeImage = app.baseImageUrl()+'facebox/closelabel.png';
$.facebox.settings.loadingImage = app.baseImageUrl()+'facebox/loading.gif';
$.facebox.settings.opacity = 0.75;
},
setupHovercards: function() {
// there's probably a better way to do this...
$("a[rel=backbone]").live("click", function(evt){
evt.preventDefault();
var link = $(this);
$(".stream_title").text(link.text())
app.router.navigate(link.attr("href").substring(1) ,true)
});
app.hovercard = new app.views.Hovercard();
},
/* mixpanel wrapper function */ /* mixpanel wrapper function */
instrument : function(type, name, object, callback) { instrument : function(type, name, object, callback) {
if(!window.mixpanel) { return } if(!window.mixpanel) { return }
......
...@@ -63,11 +63,6 @@ var View = { ...@@ -63,11 +63,6 @@ var View = {
$(document.body).click(this.dropdowns.removeFocus); $(document.body).click(this.dropdowns.removeFocus);
/* facebox */
$.facebox.settings.closeImage = app.baseImageUrl()+'facebox/closelabel.png';
$.facebox.settings.loadingImage = app.baseImageUrl()+'facebox/loading.gif';
$.facebox.settings.opacity = 0.75;
$('a[rel*=facebox]').facebox(); $('a[rel*=facebox]').facebox();
$(document).bind('reveal.facebox', function() { $(document).bind('reveal.facebox', function() {
Diaspora.page.directionDetector.updateBinds(); Diaspora.page.directionDetector.updateBinds();
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter