PageSourceSearch

https://support.centuria.pl/includes/ajs/layer/InlineLayer.StandardPositioning.js

js centuria.pl collected 2026-10-05 07:03:29 UTC 3,880 bytes, 132 lines download raw bytes

1/**
2 * @module jira/ajs/layer/inline-layer/standard-positioning
3 */
4define('jira/ajs/layer/inline-layer/standard-positioning', ['jira/lib/class', 'jquery'], function (Class, jQuery) {
5  'use strict';
6
7  /**
8   * Handles standing positioning of dropdowns
9   *
10   * @class StandardPositioning
11   * @extends Class
12   */
13  return Class.extend({
14    /**
15     * @constructs
16     */
17    init: function init() {
18      this.rebuiltCallbacks = [];
19    },
20    /**
21     * Returns coordinates for bottom left corner of target
22     *
23     * @returns {{left: Number, top: Number}}
24     */
25    left: function left() {
26      var offset = this.offset();
27      if (this.options.appendToTrigger()) {
28        var offsetParrent = this.offsetTarget().offsetParent().offset();
29        offset.left -= offsetParrent.left;
30        offset.top -= offsetParrent.top;
31      }
32      return {
33        left: offset.left,
34        top: offset.top + this.offsetTarget().outerHeight()
35      };
36    },
37    /**
38     * Returns coordinates for bottom right corner of target
39     *
40     * @returns {{left: Number, top: Number}}
41     */
42    right: function right() {
43      var offset = this.offset();
44      if (this.options.appendToTrigger()) {
45        var offsetParrent = this.offsetTarget().offsetParent().offset();
46        offset.left -= offsetParrent.left;
47        offset.top -= offsetParrent.top;
48      }
49      return {
50        left: offset.left - this.layer().outerWidth() + this.offsetTarget().outerWidth(),
51        top: offset.top + this.offsetTarget().outerHeight()
52      };
53    },
54    /**
55     * Get window. This can change dependant on if your in an iframe or not.
56     */
57    window: function (_window) {
58      function window() {
59        return _window.apply(this, arguments);
60      }
61      window.toString = function () {
62        return _window.toString();
63      };
64      return window;
65    }(function () {
66      return window;
67    }),
68    /**
69     * Get offset of target
70     * @return {Object}
71     */
72    offset: function offset() {
73      var offset = this.offsetTarget().offset();
74      if (!this.options.disableFixedPositioning() && this.offsetTarget().hasFixedParent()) {
75        this.layer().css("position", "fixed");
76        offset.top = offset.top - jQuery(window).scrollTop();
77      } else {
78        this.layer().css("position", "absolute");
79      }
80      return offset;
81    },
82    /**
83     * A callback for when elements have been modified/rebuilt. IE7 needs to do this when moving elements to parent
84     * document.
85     *
86     * @param arg
87     */
88    rebuilt: function rebuilt(arg) {
89      var instance = this;
90      if (typeof arg === 'function') {
91        this.rebuiltCallbacks.push(arg);
92      } else {
93        jQuery.each(this.rebuiltCallbacks, function () {
94          this(instance.layer());
95        });
96      }
97    },
98    /**
99     * Appends to body
100     * In future we want to append only to parent, because appending to body makes problems with keyoboard accessibility
101     * using this append is legacy, and should be removed in future
102     */
103    appendToBody: function appendToBody() {
104      this.layer().appendTo("body");
105    },
106    /**
107     *  Appends to parent(trigger element)
108     */
109    appendToTrigger: function appendToTrigger() {
110      this.layer().insertAfter(this.offsetTarget());
111    },
112    /**
113     * Appends to placeholder
114     */
115    appendToPlaceholder: function appendToPlaceholder() {
116      this.layer().appendTo(this.$placeholder);
117    },
118    /**
119     * If out of view, scrolls inline layer into view.
120     */
121    scrollTo: function scrollTo() {
122      // JRADEV-2900 says we shouldn't scroll InlineLayers anymore so the following
123      // is commented out but preserved for future generations to discover.
124      /*
125      this.layer().scrollIntoView({
126          duration: 750,
127          marginTop: this.$offsetTarget.outerHeight()
128      });
129      //*/
130    }
131  });
132});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.