jeudi 26 avril 2018

how to find modal has scrolled to the end -EmberJS

i'm newbie to emberJS and i want to enable a button when it comes to the scroll end in a modal. so i tried several ways but it didn't work

View

<div class="modal--dialog--body">

    <div class="app_tour--section--terms_container" id="message-container">

      <ul class="app_tour--section--ul">
        <li></li>
           //so many lists to scroll
        <li></li>
     </ul>
</div>

Controller

 import Ember from 'ember';
export default Ember.Controller.extend({

  didTransition() {
    Ember.run.later('afterRender', () => {
      let objDiv = document.getElementById("message-container");
      if(objDiv.scrollTop == objDiv.scrollHeight)
      console.log(objDiv.scrollTop)
    }, 100);
    return true;
  },


  actions: {

    close: function() {

      this.send('closeModal');
    }
  }
});




Aucun commentaire:

Enregistrer un commentaire