Skip to content

Commit

Permalink
fix loading of mylittleuinode
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave Conway-Jones committed Aug 7, 2020
1 parent b15cd55 commit 14441ba
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
11 changes: 7 additions & 4 deletions node-red-node-ui-mylittleuinode/mylittleuinode.html
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,9 @@
label: function() {
return this.name||"my little UI node";
},
labelStyle: function() {
return this.name?"node_label_italic":"";
},
//*********************************************************************************
//*********************************************************************************
// !!REQUIRED!!
Expand Down Expand Up @@ -241,11 +244,11 @@
<!--
***********************************************************************************
** This setion must begin with:
** <script type="text/x-red" data-template-name="ui_yournodenamehere">
** <script type="text/html" data-template-name="ui_yournodenamehere">
** It should be the same name that you are registering with Node-RED (see line #26).
***********************************************************************************
-->
<script type="text/x-red" data-template-name="ui_my-little-ui-node">
<script type="text/html" data-template-name="ui_my-little-ui-node">
<!--***************************************************************************
** !!REQUIRED!!
**
Expand Down Expand Up @@ -342,11 +345,11 @@
** The data-help-name must be the same name as you have registered this node with.
**
** This setion must begin with:
** <script type="text/x-red" data-template-name="ui_yournodenamehere">
** <script type="text/html" data-template-name="ui_yournodenamehere">
** It should be the same name that you are registering with Node-RED (see line #26).
************************************************************************************
-->
<script type="text/x-red" data-help-name="ui_my-little-ui-node">
<script type="text/html" data-help-name="ui_my-little-ui-node">
<p>A Node-RED dashboard ui node to display text with a defined color on the dashboard.</p>
<p>Use this node as a template for building your own ui node.</p>
</script>
15 changes: 8 additions & 7 deletions node-red-node-ui-mylittleuinode/mylittleuinode.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable indent */
/**
* Copyright 2018 Seth350
*
Expand Down Expand Up @@ -60,7 +61,7 @@ module.exports = function(RED) {
<input type='text' style='color:` + config.textColor + `;' ng-init='init(` + configAsJson + `)' ng-model='textContent' ng-keydown='enterkey($event)'>
`;
return html;
};
}

/********************************************************************
* REQUIRED
Expand Down Expand Up @@ -90,7 +91,7 @@ module.exports = function(RED) {

var ui = undefined;

/******************************************************************** */
/*********************************************************************/


/*********************************************************************
Expand Down Expand Up @@ -182,7 +183,7 @@ module.exports = function(RED) {
* the Node-RED flow.
*/
initController: function($scope, events) {
debugger;
//debugger;

$scope.flag = true; // not sure if this is needed?

Expand Down Expand Up @@ -246,7 +247,6 @@ module.exports = function(RED) {
};
/*******************************************************************/


}
});
}
Expand All @@ -258,8 +258,7 @@ module.exports = function(RED) {

/*******************************************************************
* !!REQUIRED!!
* TODO: Get with team on purpose of this node.
* There is no need to edit these lines.
* If you need to do any handling before closing do it here then call done().
*/
node.on("close", function() {
if (done) {
Expand All @@ -277,5 +276,7 @@ module.exports = function(RED) {
* of the function (see line #87) that will return your nodes's configuration.
* Note: the name must begin with "ui_".
*/
RED.nodes.registerType("ui_my-little-ui-node", MyLittleUiNode);
setImmediate(function() {
RED.nodes.registerType("ui_my-little-ui-node", MyLittleUiNode);
})
}
2 changes: 1 addition & 1 deletion node-red-node-ui-mylittleuinode/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-red-node-ui-mylittleuinode",
"version": "0.0.2",
"version": "0.0.3",
"description": "A Node-RED dashboard ui node to help you create your own ui node.",
"peerDependencies": {
"node-red-dashboard": ">2.15.0"
Expand Down

0 comments on commit 14441ba

Please sign in to comment.