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
a4bd5d25
Commit
a4bd5d25
authored
9 years ago
by
Amanda Ghassaei
Browse files
Options
Downloads
Patches
Plain Diff
update hex color
parent
f0ed7b21
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
js/menus/CompositeMenu.js
+6
-1
6 additions, 1 deletion
js/menus/CompositeMenu.js
js/menus/MenuParentView.js
+1
-0
1 addition, 0 deletions
js/menus/MenuParentView.js
js/menus/MenuWrapperView.js
+20
-1
20 additions, 1 deletion
js/menus/MenuWrapperView.js
with
27 additions
and
2 deletions
js/menus/CompositeMenu.js
+
6
−
1
View file @
a4bd5d25
...
@@ -30,6 +30,11 @@ define(['jquery', 'underscore', 'menuParent', 'plist', 'lattice'], function($, _
...
@@ -30,6 +30,11 @@ define(['jquery', 'underscore', 'menuParent', 'plist', 'lattice'], function($, _
lattice
.
_changeRandomColor
();
lattice
.
_changeRandomColor
();
},
},
updateHex
:
function
(
hex
){
//update hex without rendering
$
(
"
#compositeColor
"
).
css
(
"
border-color
"
,
hex
);
},
_finishComposite
:
function
(
e
){
_finishComposite
:
function
(
e
){
e
.
preventDefault
();
e
.
preventDefault
();
this
.
stopListening
();
this
.
stopListening
();
...
@@ -76,7 +81,7 @@ define(['jquery', 'underscore', 'menuParent', 'plist', 'lattice'], function($, _
...
@@ -76,7 +81,7 @@ define(['jquery', 'underscore', 'menuParent', 'plist', 'lattice'], function($, _
Name: <input id="compositeName" data-property="compositeName" value="<%= compositeName %>" placeholder="Enter Name" class="seventyFiveWidth form-control textInput lattice" type="text"><br/><br/>
\
Name: <input id="compositeName" data-property="compositeName" value="<%= compositeName %>" placeholder="Enter Name" class="seventyFiveWidth form-control textInput lattice" type="text"><br/><br/>
\
Bounding Box: ()<br/><br/>
\
Bounding Box: ()<br/><br/>
\
Display Color:
\
Display Color:
\
<input style="border-color: <%= compositeColor %> ;" value="<%= compositeColor %>" placeholder="Enter HEX" class="halfWidth form-control" type="text"><br/><br/>
\
<input
id="compositeColor"
style="border-color: <%= compositeColor %> ;"
data-property="compositeColor"
value="<%= compositeColor %>" placeholder="Enter HEX" class="halfWidth
lattice
form-control
hexInput
" type="text"><br/><br/>
\
<a id="newRandomColor" href="#" class="btn btn-block btn-lg btn-default">New Random Color</a><br/><br/>
\
<a id="newRandomColor" href="#" class="btn btn-block btn-lg btn-default">New Random Color</a><br/><br/>
\
<a id="finishComposite" href="#" class="btn btn-block btn-lg btn-success">Finish Composite</a><br/>
\
<a id="finishComposite" href="#" class="btn btn-block btn-lg btn-success">Finish Composite</a><br/>
\
<a id="cancelComposite" href="#" class="btn btn-halfWidth btn-lg btn-default">Cancel / Exit</a>
\
<a id="cancelComposite" href="#" class="btn btn-halfWidth btn-lg btn-default">Cancel / Exit</a>
\
...
...
This diff is collapsed.
Click to expand it.
js/menus/MenuParentView.js
+
1
−
0
View file @
a4bd5d25
...
@@ -20,6 +20,7 @@ define(['jquery', 'underscore', 'backbone'], function($, _, Backbone){
...
@@ -20,6 +20,7 @@ define(['jquery', 'underscore', 'backbone'], function($, _, Backbone){
if
(
this
.
model
.
changedAttributes
()[
"
currentNav
"
])
return
;
if
(
this
.
model
.
changedAttributes
()[
"
currentNav
"
])
return
;
if
(
$
(
"
input[type=text]
"
).
is
(
"
:focus
"
))
return
;
if
(
$
(
"
input[type=text]
"
).
is
(
"
:focus
"
))
return
;
this
.
$el
.
html
(
this
.
template
(
this
.
_makeTemplateJSON
()));
this
.
$el
.
html
(
this
.
template
(
this
.
_makeTemplateJSON
()));
this
.
$el
.
html
(
this
.
template
(
this
.
_makeTemplateJSON
()));
if
(
this
.
_render
)
this
.
_render
();
if
(
this
.
_render
)
this
.
_render
();
},
},
...
...
This diff is collapsed.
Click to expand it.
js/menus/MenuWrapperView.js
+
20
−
1
View file @
a4bd5d25
...
@@ -44,7 +44,8 @@ define(['jquery', 'underscore', 'plist', 'backbone', 'lattice'], function($, _,
...
@@ -44,7 +44,8 @@ define(['jquery', 'underscore', 'plist', 'backbone', 'lattice'], function($, _,
}
}
if
(
$
(
"
.floatInput
"
).
is
(
"
:focus
"
))
this
.
_updateFloat
(
e
);
if
(
$
(
"
.floatInput
"
).
is
(
"
:focus
"
))
this
.
_updateFloat
(
e
);
if
(
$
(
"
.intInput
"
).
is
(
"
:focus
"
))
this
.
_updateInt
(
e
);
if
(
$
(
"
.intInput
"
).
is
(
"
:focus
"
))
this
.
_updateInt
(
e
);
if
(
$
(
"
.textInput
"
).
is
(
"
:focus
"
))
this
.
_updateString
(
e
);
if
(
$
(
"
.textInput
"
).
is
(
"
:focus
"
))
this
.
_updateString
(
e
)
if
(
$
(
"
.hexInput
"
).
is
(
"
:focus
"
))
this
.
_updateHex
(
e
);
},
},
_updateString
:
function
(
e
){
_updateString
:
function
(
e
){
...
@@ -58,6 +59,24 @@ define(['jquery', 'underscore', 'plist', 'backbone', 'lattice'], function($, _,
...
@@ -58,6 +59,24 @@ define(['jquery', 'underscore', 'plist', 'backbone', 'lattice'], function($, _,
this
.
_getPropertyOwner
(
$target
).
set
(
property
,
$target
.
val
());
this
.
_getPropertyOwner
(
$target
).
set
(
property
,
$target
.
val
());
},
},
_updateHex
:
function
(
e
){
e
.
preventDefault
();
var
$target
=
$
(
e
.
target
);
var
hex
=
$target
.
val
();
if
(
!
this
.
_isValidHex
(
hex
))
return
;
var
property
=
$target
.
data
(
"
property
"
);
if
(
!
property
)
{
console
.
warn
(
"
no property associated with string input
"
);
return
;
}
this
.
_getPropertyOwner
(
$target
).
set
(
property
,
hex
);
if
(
this
.
menu
.
updateHex
)
this
.
menu
.
updateHex
(
hex
);
},
_isValidHex
:
function
(
hex
){
return
hex
.
match
(
/
(
^#
[
0-9A-F
]{6}
$
)
|
(
^#
[
0-9A-F
]{3}
$
)
/i
)
!==
null
;
},
_updateFloat
:
function
(
e
){
_updateFloat
:
function
(
e
){
e
.
preventDefault
();
e
.
preventDefault
();
var
$target
=
$
(
e
.
target
);
var
$target
=
$
(
e
.
target
);
...
...
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