mc.js 959 B

1234567891011121314151617181920212223242526
  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. var body = $(window.top.document.body), icon = $(this).find('i');
  16. if(body.is('.stag_rhs_collapsed')) {
  17. icon.removeClass().addClass('fa fa-arrow-left');
  18. }
  19. });
  20. function openInRHS(_url) {
  21. window.top.showRHS();
  22. var icon = $('.stag_rhs_toggle i');
  23. icon.removeClass().addClass('fa fa-arrow-right');
  24. window.top.openInRHS(_url);
  25. return false;
  26. }