[go: nahoru, domu]

Skip to content

Commit

Permalink
extend api doc
Browse files Browse the repository at this point in the history
  • Loading branch information
brigadir committed Dec 19, 2018
1 parent af9c9d8 commit 619dd9d
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 11 deletions.
21 changes: 20 additions & 1 deletion src/js/ui/ui.menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,13 @@ zebkit.package("ui", function(pkg, Class) {
},

function $prototype() {
/**
* Menu item handler function.
* @private
* @attribute $handler
* @readOnly
* @type {Function}
*/
this.$handler = null;

/**
Expand Down Expand Up @@ -402,6 +409,13 @@ zebkit.package("ui", function(pkg, Class) {
},

function $prototype() {
/**
* Parent menu reference/
* @attribute $parentMenu
* @readOnly
* @private
* @type {zebkit.ui.Menu}
*/
this.$parentMenu = null;

this.canHaveFocus = true;
Expand Down Expand Up @@ -517,7 +531,12 @@ zebkit.package("ui", function(pkg, Class) {
}
};

// TODO: not stable API
/**
* Get menu item by id.
* @param {String} id an id.
* @return {zebkit.ui.MenuItem} a menu item
* @method menuItemById
*/
this.menuItemById = function(id) {
for (var i = 0; i < this.kids.length; i++) {
var mi = this.kids[i];
Expand Down
68 changes: 58 additions & 10 deletions src/js/ui/ui.panels.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ zebkit.package("ui", function(pkg, Class) {
* @type {zebkit.ui.Panel}
* @readOnly
*/
this.label = null;
this.label = null;

/**
* Vertical gap. Define top and bottom paddings between
Expand All @@ -80,6 +80,7 @@ zebkit.package("ui", function(pkg, Class) {
* @readOnly
* @default 0
*/
this.vGap = 2;

/**
* Horizontal gap. Define left and right paddings between
Expand All @@ -89,7 +90,7 @@ zebkit.package("ui", function(pkg, Class) {
* @readOnly
* @default 0
*/
this.vGap = this.hGap = 2;
this.hGap = 2;

/**
* Border panel label indent
Expand All @@ -98,7 +99,7 @@ zebkit.package("ui", function(pkg, Class) {
* @readOnly
* @default 4
*/
this.indent = 4;
this.indent = 4;

/**
* Border panel title area arrangement. Border title can be placed
Expand Down Expand Up @@ -377,6 +378,7 @@ zebkit.package("ui", function(pkg, Class) {
* @readOnly
* @default 50
*/
this.leftMinSize = 50;

/**
* A minimal size of right (or bottom) sizable panel
Expand All @@ -385,6 +387,7 @@ zebkit.package("ui", function(pkg, Class) {
* @readOnly
* @default 50
*/
this.rightMinSize = 50;

/**
* Indicates if the splitter bar can be moved
Expand All @@ -393,6 +396,7 @@ zebkit.package("ui", function(pkg, Class) {
* @readOnly
* @default true
*/
this.isMoveable = true;

/**
* A gap between gripper element and first and second UI components
Expand All @@ -401,36 +405,52 @@ zebkit.package("ui", function(pkg, Class) {
* @readOnly
* @default 1
*/
this.gap = 1;

/**
* A reference to gripper UI component
* @attribute gripper
* @type {zebkit.ui.Panel}
* @readOnly
*/
this.gripper = null;

/**
* A reference to left (top) sizable UI component
* @attribute leftComp
* @type {zebkit.ui.Panel}
* @readOnly
*/
this.leftComp = null;

/**
* A reference to right (bottom) sizable UI component
* @attribute rightComp
* @type {zebkit.ui.Panel}
* @readOnly
*/
this.rightComp = null;

this.leftMinSize = this.rightMinSize = 50;
this.isMoveable = true;
this.gap = 1;
/**
* Split panel orientation
* @attribute orient
* @type {String}
* @readOnly
*/
this.orient = "vertical";

this.minXY = this.maxXY = 0;
/**
* Split panel bar location.
* @attribute barLocation
* @type {Number}
* @protected
* @readOnly
*/
this.barLocation = 70;
this.leftComp = this.rightComp = this.gripper = null;

this.minXY = 0;

this.maxXY = 0;

this.normalizeBarLoc = function(xy){
if (xy < this.minXY) {
Expand Down Expand Up @@ -793,7 +813,7 @@ zebkit.package("ui", function(pkg, Class) {

function $prototype() {
/**
* Title panel
* Header panel
* @type {zebkit.ui.Panel}
* @attribute headerPan
* @readOnly
Expand All @@ -816,24 +836,46 @@ zebkit.package("ui", function(pkg, Class) {
*/
this.togglePan = null;

/**
* Set collapsing state.
* @param {boolean} b a collapsing state.
* @method setValue
* @chainable
*/
this.setValue = function(b) {
if (this.togglePan !== null) {
this.togglePan.setValue(b);
}
return this;
};

this.getValue = function(b) {
/**
* Get collapsing state
* @return {boolean} a collapsing state
* @method getValue
*/
this.getValue = function() {
return (this.togglePan !== null) ? this.togglePan.getValue() : false;
};

/**
* Set group.
* @method setGroup
* @param {zebkit.ui.Group} g a group
* @chainable
*/
this.setGroup = function(g) {
if (this.togglePan !== null) {
this.togglePan.setGroup(g);
}
return this;
};

/**
* Toggle collapsing state
* @chainable
* @method toggle
*/
this.toggle = function() {
if (this.togglePan !== null) {
this.togglePan.toggle();
Expand Down Expand Up @@ -884,6 +926,12 @@ zebkit.package("ui", function(pkg, Class) {
},

function $prototype() {
/**
* Applied to elements border view
* @attribute borderView
* @readOnly
* @type {zebkit.draw.View}
*/
this.borderView = null;

/**
Expand Down

0 comments on commit 619dd9d

Please sign in to comment.