ArcGIS Online Pop-up Docker

Replaces functionality of maximize button in ArcGIS Online webmap & app pop-ups, to dock the pop-up in top-right corner instead of filling the whole screen uselessly

  1. // ==UserScript==
  2. // @name ArcGIS Online Pop-up Docker
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.1
  5. // @description Replaces functionality of maximize button in ArcGIS Online webmap & app pop-ups, to dock the pop-up in top-right corner instead of filling the whole screen uselessly
  6. // @author mky
  7. // @supportURL https://greasyfork.org/en/scripts/375717-arcgis-online-pop-up-docker/feedback
  8. // @match *.maps.arcgis.com/*
  9. // @run-at document-idle
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. //dock on pop-up click --disabled on default
  17. //addGlobalStyle('.esriPopupVisible { top:auto !important; left:auto !important; right: 306px !important; top: 10px !important; }');
  18. //addGlobalStyle('.esriPopup .outerPointer {display:none !important}');
  19. //addGlobalStyle('.esriPopup .pointer {display:none !important}');
  20.  
  21. //dock on pop-up maximize click
  22. addGlobalStyle('.esriPopupWrapper {top: 10px !important; left: 16px !important}');
  23. addGlobalStyle('.esriPopupMaximized { left:auto !important; right: 356px !important; top: 10px !important;}');
  24. addGlobalStyle('.esriPopupMaximized .sizer {!important; width:320px !important; max-width:320px !important;}');
  25. addGlobalStyle('.esriPopupMaximized .sizer .contentPane { height:auto !important; max-height:550px !important;}');
  26.  
  27.  
  28. function addGlobalStyle(css) {
  29. var head, style;
  30. head = document.getElementsByTagName('head')[0];
  31. if (!head) { return; }
  32. style = document.createElement('style');
  33. style.type = 'text/css';
  34. style.innerHTML = css;
  35. head.appendChild(style);
  36. }
  37. })();