Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
65 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,13 +1,15 @@ | |||
//* Base kind for the Grouping api | |||
enyo.kind({ | enyo.kind({ | ||
name: "enyo.GroupItem", | name: "enyo.GroupItem", | ||
published: { | published: { | ||
active: false | active: false | ||
}, | }, | ||
//* @protected | |||
create: function() { | create: function() { | ||
this.inherited(arguments); | this.inherited(arguments); | ||
this.activeChanged(); | this.activeChanged(); | ||
}, | }, | ||
activeChanged: function() { | activeChanged: function() { | ||
this.bubble("onActivate"); | this.bubble("onActivate"); | ||
} | } | ||
}); | }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,6 +1,9 @@ | |||
/** | |||
A control that returns as its components HTML as its own. | |||
*/ | |||
enyo.kind({ | enyo.kind({ | ||
name: "enyo.NoDom", | name: "enyo.NoDom", | ||
generateOuterHtml: function(inHtml) { | generateOuterHtml: function(inHtml) { | ||
return inHtml; | return inHtml; | ||
} | } | ||
}); | }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,37 +1,45 @@ | |||
enyo.kind({ | /** | ||
A simple control for making lists of items. | |||
Components of Repeater are copied for each row created, wrapped in a control keeping state of the row index. | |||
Example: | |||
{kind: "Repeater", rows: 2, onSetupRow: "setImageSource", components: [ | |||
{kind: "Image"} | |||
]} | |||
setImageSource: function(inSender, inEvent) { | |||
var index = inEvent.index; | |||
var rowControl = inEvent.row; | |||
rowControl.$.image.setSrc(this.imageSources[index]); | |||
} | |||
*/ | |||
enyo.kind({ | |||
name: "enyo.Repeater", | name: "enyo.Repeater", | ||
kind: enyo.Control, | kind: enyo.Control, | ||
published: { | published: { | ||
//* How many rows to render | |||
rows: 0 | rows: 0 | ||
}, | }, | ||
events: { | events: { | ||
//* Sends the row index, and the row control, for decoration | |||
onSetupRow: "" | onSetupRow: "" | ||
}, | }, | ||
//* @protected | |||
initComponents: function() { | initComponents: function() { | ||
this.rowComponents = this.components; | this.rowComponents = this.components; | ||
this.components = null; | this.components = null; | ||
this.inherited(arguments); | this.inherited(arguments); | ||
}, | }, | ||
//* @protected | //* @public | ||
generateInnerHtml: function() { | //* Render the list | ||
//this.build(); | |||
return this.inherited(arguments); | |||
}, | |||
build: function() { | build: function() { | ||
this.destroyClientControls(); | this.destroyClientControls(); | ||
for (var i=0; i<this.rows; i++) { | for (var i=0; i<this.rows; i++) { | ||
var c = this.createComponent({kind: "NoDom", rowIndex: i}); | var c = this.createComponent({kind: "NoDom", rowIndex: i}); | ||
c.createComponents(this.rowComponents); | c.createComponents(this.rowComponents); | ||
this.doSetupRow({index: i, row: c}); | this.doSetupRow({index: i, row: c}); | ||
} | } | ||
}, | |||
XdispatchEvent: function(inEventName, inEvent, inSender) { | |||
if (inSender && inSender.owner == this) { | |||
var delegate = inEvent.originator[inEventName]; | |||
if (delegate && this.dispatch(this.owner, delegate, inEvent, inSender)) { | |||
return true; | |||
} | |||
} | |||
return this.inherited(arguments); | |||
} | } | ||
}); | }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,5 +1,7 @@ | |||
//* Lines up components in a row, centered vertically | |||
enyo.kind({ | enyo.kind({ | ||
name: "enyo.ToolDecorator", | name: "enyo.ToolDecorator", | ||
//* @protected | |||
kind: enyo.GroupItem, | kind: enyo.GroupItem, | ||
classes: "enyo-tool-decorator" | classes: "enyo-tool-decorator" | ||
}); | }); |