Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8098337
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T22:03:06+00:00 2026-06-05T22:03:06+00:00

I am having a weird issue with the image gallery Galleria.js and backbone. This

  • 0

I am having a weird issue with the image gallery Galleria.js and backbone.

This view is sometimes hidden and then re-rendered with a different model. What is happening is that after re-rendering 2 or 3 times, the browser’s CPU usage spikes to 100%. I confirmed that Galleria is cause this, because I removed it from the view and the CPU was normal.

I am thinking that I might need to destroy the view when hiding or something? Not entirely sure about how to approach this.

App.HouseDetailView = Backbone.View.extend({
    el: '.house-details-area', 
    initialize: function() {
        this.template = _.template($('#house-details-template').html());
        App.Events.on('show_house', this.render, this);
        App.Events.on('show_main_view', this.hide, this);
    },
    events: {
        'click .btn-close': 'hide',
        'shown a[data-toggle="tab"][href=".detail-map"]' : 'show_map',
        'shown a[data-toggle="tab"][href=".detail-street-view"]' : 'show_street_view',
        'change .calculate-price': 'calculate_price',
    },
    render: function(model) {
          this.model = model;
          var html = this.template({model:model.toJSON()});
          $(this.el).html(html);
          Galleria.loadTheme('/static/js/libs/galleria.classic.min.js');
          Galleria.run('#galleria', {wait: true});
          $(this.el).show();
          return this;

    },
    hide: function() {
        $(this.el).hide();
        App.detailsRouter.navigate('/', true);
    },
    show_map: function() {
        // check if map already rendered
        if (this.$('.detail-map').html() === '') {
          var map = new App.DetailMapView({model:this.model});
          this.$('.detail-map').html(map.el);
          map.refresh();  
        }         
    },
    show_street_view: function() {
        if (this.$('.detail-street-view').html() === '') {
            var street_view = new App.DetailStreetView({model:this.model});
            this.$('.detail-street-view').append(street_view.el);
            street_view.render();
        }   
    },
    calculate_price: function (e) {
        var price_element = this.$('.price');
        var total_price = parseFloat(price_element.attr('data-total-price'));
        var people = parseFloat(price_element.attr('data-people'));
        // if selected is 1st option: Total price
        if (e.srcElement.selectedIndex === 0) {
            // show total price
            price_element.html('$' + total_price.toFixed(2));
        } else {
            // show per person price
            price_element.html('$' + (total_price/people).toFixed(2));
        }
    },
});
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T22:03:07+00:00Added an answer on June 5, 2026 at 10:03 pm

    I was able to fix this issue by removing Galleria.loadTheme('/static/js/libs/galleria.classic.min.js'); from the view’s render() method.

    I only load the Galleria theme once when the App is initialized.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having this weird issue when I was trying to merge my projects
I'm having this weird issue and I'm hoping someone could clear this up for
I am having this weird issue with Cruise Control crashing, when I add the
Having a weird issue with jQuery/JavaScript. I'm using this code: var minimumPercent = $('.donationTextBox').val();
I've been having this weird issue when trying to do a UI animation between
I am having this really weird issue with downloading files from within ASP.Net MVC
I am having a weird issue with my keyboard automatically closing and then reopening
I was having a weird issue with a very simple model. When posted back
This is a weird issue I'm having, I have a table and try to
I am having a really weird issue with my image saving method. First, here

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.