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.

66 lines
2.4 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.apply(Ext.Element.prototype, function() {
  19. var GETDOM = Ext.getDom,
  20. GET = Ext.get,
  21. DH = Ext.DomHelper;
  22. return {
  23. <div id="method-Ext.Element-insertSibling"></div>/**
  24. * Inserts (or creates) the passed element (or DomHelper config) as a sibling of this element
  25. * @param {Mixed/Object/Array} el The id, element to insert or a DomHelper config to create and insert *or* an array of any of those.
  26. * @param {String} where (optional) 'before' or 'after' defaults to before
  27. * @param {Boolean} returnDom (optional) True to return the raw DOM element instead of Ext.Element
  28. * @return {Ext.Element} The inserted Element. If an array is passed, the last inserted element is returned.
  29. */
  30. insertSibling: function(el, where, returnDom){
  31. var me = this,
  32. rt,
  33. isAfter = (where || 'before').toLowerCase() == 'after',
  34. insertEl;
  35. if(Ext.isArray(el)){
  36. insertEl = me;
  37. Ext.each(el, function(e) {
  38. rt = Ext.fly(insertEl, '_internal').insertSibling(e, where, returnDom);
  39. if(isAfter){
  40. insertEl = rt;
  41. }
  42. });
  43. return rt;
  44. }
  45. el = el || {};
  46. if(el.nodeType || el.dom){
  47. rt = me.dom.parentNode.insertBefore(GETDOM(el), isAfter ? me.dom.nextSibling : me.dom);
  48. if (!returnDom) {
  49. rt = GET(rt);
  50. }
  51. }else{
  52. if (isAfter && !me.dom.nextSibling) {
  53. rt = DH.append(me.dom.parentNode, el, !returnDom);
  54. } else {
  55. rt = DH[isAfter ? 'insertAfter' : 'insertBefore'](me.dom, el, !returnDom);
  56. }
  57. }
  58. return rt;
  59. }
  60. };
  61. }());</pre>
  62. </body>
  63. </html>