~mortenoh/+junk/dhis2-detailed-import-export

« back to all changes in this revision

Viewing changes to gis/dhis-gis-geostat/mfbase/ext/source/widgets/layout/AbsoluteLayout.js

  • Committer: larshelge at gmail
  • Date: 2009-03-03 16:46:36 UTC
  • Revision ID: larshelge@gmail.com-20090303164636-2sjlrquo7ib1gf7r
Initial check-in

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Ext JS Library 2.2
 
3
 * Copyright(c) 2006-2008, Ext JS, LLC.
 
4
 * licensing@extjs.com
 
5
 * 
 
6
 * http://extjs.com/license
 
7
 */
 
8
 
 
9
/**
 
10
 * @class Ext.layout.AbsoluteLayout
 
11
 * @extends Ext.layout.AnchorLayout
 
12
 * <p>Inherits the anchoring of {@link Ext.layout.AnchorLayout} and adds the ability for x/y positioning using the
 
13
 * standard x and y component config options.</p>
 
14
 */
 
15
Ext.layout.AbsoluteLayout = Ext.extend(Ext.layout.AnchorLayout, {
 
16
    extraCls: 'x-abs-layout-item',
 
17
    isForm: false,
 
18
    // private
 
19
    setContainer : function(ct){
 
20
        Ext.layout.AbsoluteLayout.superclass.setContainer.call(this, ct);
 
21
        if(ct.isXType('form')){
 
22
            this.isForm = true;
 
23
        }
 
24
    },
 
25
 
 
26
    onLayout : function(ct, target){
 
27
        if(this.isForm){ ct.body.position(); } else { target.position(); }
 
28
        Ext.layout.AbsoluteLayout.superclass.onLayout.call(this, ct, target);
 
29
    },
 
30
 
 
31
    // private
 
32
    getAnchorViewSize : function(ct, target){
 
33
        return this.isForm ? ct.body.getStyleSize() : Ext.layout.AbsoluteLayout.superclass.getAnchorViewSize.call(this, ct, target);
 
34
    },
 
35
 
 
36
    // private
 
37
    isValidParent : function(c, target){
 
38
        return this.isForm ? true : Ext.layout.AbsoluteLayout.superclass.isValidParent.call(this, c, target);
 
39
    },
 
40
 
 
41
    // private
 
42
    adjustWidthAnchor : function(value, comp){
 
43
        return value ? value - comp.getPosition(true)[0] : value;
 
44
    },
 
45
 
 
46
    // private
 
47
    adjustHeightAnchor : function(value, comp){
 
48
        return  value ? value - comp.getPosition(true)[1] : value;
 
49
    }
 
50
    /**
 
51
     * @property activeItem
 
52
     * @hide
 
53
     */
 
54
});
 
55
Ext.Container.LAYOUTS['absolute'] = Ext.layout.AbsoluteLayout;
 
 
b'\\ No newline at end of file'