mc.js 785 B

12345678910111213141516171819202122
  1. window.top.addEventListener('popstate', function(event) {
  2. if(!!event.state) window.location = event.state;
  3. });
  4. $(document).ready(function() {
  5. window.top.history.replaceState(window.location.pathname, null, '/mc' + window.location.pathname);
  6. $(document).on('click', '.stag_rhs_toggle', function() {
  7. var state = window.top.toggleRHS(), icon = $(this).find('i');
  8. if(state === 'collapsed') {
  9. icon.removeClass().addClass('fa fa-arrow-left');
  10. }
  11. else {
  12. icon.removeClass().addClass('fa fa-arrow-right');
  13. }
  14. });
  15. });
  16. function openInRHS(_url) {
  17. window.top.showRHS();
  18. var icon = $('.stag_rhs_toggle i');
  19. icon.removeClass().addClass('fa fa-arrow-right');
  20. window.top.openInRHS(_url);
  21. return false;
  22. }