Web Interface For Lite Argus Control modules
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.

85 lines
2.6 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  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.CompositeElementLite
  17. */
  18. Ext.apply(Ext.CompositeElementLite.prototype, {
  19. addElements : function(els, root){
  20. if(!els){
  21. return this;
  22. }
  23. if(typeof els == "string"){
  24. els = Ext.Element.selectorFunction(els, root);
  25. }
  26. var yels = this.elements;
  27. Ext.each(els, function(e) {
  28. yels.push(Ext.get(e));
  29. });
  30. return this;
  31. },
  32. <div id="method-Ext.CompositeElementLite-first"></div>/**
  33. * Returns the first Element
  34. * @return {Ext.Element}
  35. */
  36. first : function(){
  37. return this.item(0);
  38. },
  39. <div id="method-Ext.CompositeElementLite-last"></div>/**
  40. * Returns the last Element
  41. * @return {Ext.Element}
  42. */
  43. last : function(){
  44. return this.item(this.getCount()-1);
  45. },
  46. <div id="method-Ext.CompositeElementLite-contains"></div>/**
  47. * Returns true if this composite contains the passed element
  48. * @param el {Mixed} The id of an element, or an Ext.Element, or an HtmlElement to find within the composite collection.
  49. * @return Boolean
  50. */
  51. contains : function(el){
  52. return this.indexOf(el) != -1;
  53. },
  54. <div id="method-Ext.CompositeElementLite-removeElement"></div>/**
  55. * Removes the specified element(s).
  56. * @param {Mixed} el The id of an element, the Element itself, the index of the element in this composite
  57. * or an array of any of those.
  58. * @param {Boolean} removeDom (optional) True to also remove the element from the document
  59. * @return {CompositeElement} this
  60. */
  61. removeElement : function(keys, removeDom){
  62. var me = this,
  63. els = this.elements,
  64. el;
  65. Ext.each(keys, function(val){
  66. if ((el = (els[val] || els[val = me.indexOf(val)]))) {
  67. if(removeDom){
  68. if(el.dom){
  69. el.remove();
  70. }else{
  71. Ext.removeNode(el);
  72. }
  73. }
  74. els.splice(val, 1);
  75. }
  76. });
  77. return this;
  78. }
  79. });
  80. </pre>
  81. </body>
  82. </html>