mardi 7 mars 2017

UI bread crumbs flickering issue in ember

I have to display bread-crumbs (path of the current folder) in my application.My app will also have the list of folders.I have a attribute called parentfolder in my services called file.Server request is sent whenever the user presses a folder after few seconds response will come from the server and I will set the response data with the parentfolder attribute in file service.In my template I am running an each helper to display the path of the current folder.The problem I am facing is when a folder is clicked parentfolder attribute is emptied initially and set with the server response as soon as it is arrived.But in the time between the request and response parentfolder is emptied so it is not dispalying the path and as soon as the response arrived the breadcrumb is reconstructed.It causes a flickering in my breadcrumbs view.Can anyone help me to avoid this flickering?

bc.js

import Ember from 'ember'; // No I18N
const { Component, inject, computed } = Ember;
export default Component.extend({
  file: inject.service()

});

bc.hbs

<div class="ui breadcrumb">
        

            <svg class="icon-12">
        <use xlink:href="#svg-rhtarrow-icon"> </use>
      </svg>

              

        
</div>

In short I want to get the hold whether the response has arrived or not in my template.So accordingly I will update the view.




Aucun commentaire:

Enregistrer un commentaire