Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DMDesign
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Amanda Ghassaei
DMDesign
Commits
40cbc1d0
Commit
40cbc1d0
authored
9 years ago
by
Amanda Ghassaei
Browse files
Options
Downloads
Patches
Plain Diff
properties synced
parent
068abffb
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
js/SerialMonitor/SerialMonitor.js
+4
-2
4 additions, 2 deletions
js/SerialMonitor/SerialMonitor.js
js/SerialMonitor/SerialMonitorView.js
+36
-1
36 additions, 1 deletion
js/SerialMonitor/SerialMonitorView.js
js/SerialMonitor/main.js
+2
-2
2 additions, 2 deletions
js/SerialMonitor/main.js
with
42 additions
and
5 deletions
js/SerialMonitor/SerialMonitor.js
+
4
−
2
View file @
40cbc1d0
...
...
@@ -5,11 +5,13 @@
define
([
'
backbone
'
],
function
(
Backbone
){
return
Backbone
.
Model
.
extend
({
var
SerialMonitor
=
Backbone
.
Model
.
extend
({
defaults
:
{
autoscroll
:
tru
e
autoscroll
:
fals
e
}
});
return
new
SerialMonitor
();
});
\ No newline at end of file
This diff is collapsed.
Click to expand it.
js/SerialMonitor/SerialMonitorView.js
+
36
−
1
View file @
40cbc1d0
...
...
@@ -11,13 +11,48 @@ define(['jquery', 'underscore', 'commParentMenu', 'serialComm', 'text!SerialMoni
el
:
"
#serialMonitorView
"
,
events
:
{
"
click #clearMonitor
"
:
"
_clear
"
"
click #clearMonitor
"
:
"
_clear
"
,
"
change input:checkbox
"
:
"
_clickCheckbox
"
},
__initialize
:
function
(){
this
.
render
();
},
_clickCheckbox
:
function
(
e
){
e
.
preventDefault
();
var
$target
=
$
(
e
.
target
);
$target
.
blur
();
var
property
=
$target
.
data
(
"
property
"
);
if
(
!
property
)
{
console
.
warn
(
"
no property associated with checkbox input
"
);
return
;
}
this
.
_toggleProperty
(
$target
,
property
);
},
_toggleProperty
:
function
(
$target
,
property
){
//val = !val
var
owner
=
this
.
_getPropertyOwner
(
$target
);
if
(
owner
)
this
.
_setOwnerProperty
(
owner
,
property
,
!
(
this
.
_getOwnerProperty
(
owner
,
property
)));
},
_getPropertyOwner
:
function
(
$target
){
if
(
$target
.
hasClass
(
"
serialMonitor
"
))
return
this
.
model
;
return
null
;
},
_getOwnerProperty
:
function
(
owner
,
property
){
if
(
owner
instanceof
Backbone
.
Model
)
return
owner
.
get
(
property
);
return
owner
[
property
];
},
_setOwnerProperty
:
function
(
owner
,
property
,
value
){
if
(
owner
instanceof
Backbone
.
Model
)
owner
.
set
(
property
,
value
);
else
{
owner
[
property
]
=
value
;
}
},
_makeTemplateJSON
:
function
(){
return
this
.
model
.
toJSON
();
},
...
...
This diff is collapsed.
Click to expand it.
js/SerialMonitor/main.js
+
2
−
2
View file @
40cbc1d0
...
...
@@ -35,6 +35,6 @@ require.config({
});
require
([
'
serialMonitorView
'
,
'
serialMonitor
'
],
function
(
SerialMonitorView
,
S
erialMonitor
){
new
SerialMonitorView
({
model
:
new
S
erialMonitor
()
});
require
([
'
serialMonitorView
'
,
'
serialMonitor
'
],
function
(
SerialMonitorView
,
s
erialMonitor
){
new
SerialMonitorView
({
model
:
s
erialMonitor
});
});
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment