source: main/trunk/greenstone3/web/interfaces/default_new/js/berrybasket/ygDDOnTop.js@ 29852

Last change on this file since 29852 was 29852, checked in by Georgiy Litvinov, 9 years ago

Ckeditor integration commit

  • Property svn:executable set to *
File size: 1.1 KB
Line 
1
2/* Copyright (c) 2006 Yahoo! Inc. All rights reserved. */
3
4/**
5 * @class a DragDrop implementation that moves the object as it is being dragged,
6 * and keeps the object being dragged on top. This is a subclass of ygDD rather
7 * than DragDrop, and inherits the implementation of most of the event listeners
8 * from that class.
9 *
10 * @extends ygDD
11 * @constructor
12 * @param {String} id the id of the linked element
13 * @param {String} sGroup the group of related DragDrop items
14 */
15function ygDDOnTop(id, sGroup) {
16 if (id) {
17 this.init(id, sGroup);
18
19 }
20}
21
22ygDDOnTop.prototype = new YAHOO.util.DD();
23
24/**
25 * The inital z-index of the element, stored so we can restore it later
26 *
27 * @type int
28 */
29ygDDOnTop.prototype.origZ = 0;
30
31ygDDOnTop.prototype.startDrag = function(x, y) {
32
33 var style = this.getEl().style;
34
35 // store the original z-index
36 this.origZ = style.zIndex;
37
38 // The z-index needs to be set very high so the element will indeed be on top
39 style.zIndex = 999;
40}
41
42ygDDOnTop.prototype.endDrag = function(e) {
43
44 // restore the original z-index
45 this.getEl().style.zIndex = this.origZ;
46};
Note: See TracBrowser for help on using the repository browser.