Web UI for ARGUS server
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

67 lines
2.3 KiB

6 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  4. <title>The source code</title>
  5. <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
  6. <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
  7. </head>
  8. <body onload="prettyPrint();">
  9. <pre class="prettyprint lang-js">/*!
  10. * Ext JS Library 3.3.1
  11. * Copyright(c) 2006-2010 Sencha Inc.
  12. * licensing@sencha.com
  13. * http://www.sencha.com/license
  14. */
  15. /**
  16. * @class Ext.Element
  17. */
  18. Ext.Element.addMethods({
  19. <div id="method-Ext.Element-isScrollable"></div>/**
  20. * Returns true if this element is scrollable.
  21. * @return {Boolean}
  22. */
  23. isScrollable : function(){
  24. var dom = this.dom;
  25. return dom.scrollHeight > dom.clientHeight || dom.scrollWidth > dom.clientWidth;
  26. },
  27. <div id="method-Ext.Element-scrollTo"></div>/**
  28. * Scrolls this element the specified scroll point. It does NOT do bounds checking so if you scroll to a weird value it will try to do it. For auto bounds checking, use scroll().
  29. * @param {String} side Either "left" for scrollLeft values or "top" for scrollTop values.
  30. * @param {Number} value The new scroll value.
  31. * @return {Element} this
  32. */
  33. scrollTo : function(side, value){
  34. this.dom["scroll" + (/top/i.test(side) ? "Top" : "Left")] = value;
  35. return this;
  36. },
  37. <div id="method-Ext.Element-getScroll"></div>/**
  38. * Returns the current scroll position of the element.
  39. * @return {Object} An object containing the scroll position in the format {left: (scrollLeft), top: (scrollTop)}
  40. */
  41. getScroll : function(){
  42. var d = this.dom,
  43. doc = document,
  44. body = doc.body,
  45. docElement = doc.documentElement,
  46. l,
  47. t,
  48. ret;
  49. if(d == doc || d == body){
  50. if(Ext.isIE && Ext.isStrict){
  51. l = docElement.scrollLeft;
  52. t = docElement.scrollTop;
  53. }else{
  54. l = window.pageXOffset;
  55. t = window.pageYOffset;
  56. }
  57. ret = {left: l || (body ? body.scrollLeft : 0), top: t || (body ? body.scrollTop : 0)};
  58. }else{
  59. ret = {left: d.scrollLeft, top: d.scrollTop};
  60. }
  61. return ret;
  62. }
  63. });</pre>
  64. </body>
  65. </html>