Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
freecad_x3d
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Elphel
freecad_x3d
Commits
f9660332
Commit
f9660332
authored
Mar 29, 2016
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
undo button for right clicks
parent
b8639e79
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
1 deletion
+21
-1
viewmodel.js
x3d_web_viewer/viewmodel.js
+21
-1
No files found.
x3d_web_viewer/viewmodel.js
View file @
f9660332
...
@@ -22,6 +22,8 @@ var inherited_parameters = "";
...
@@ -22,6 +22,8 @@ var inherited_parameters = "";
var
screen_ratio
=
1
;
//w/h
var
screen_ratio
=
1
;
//w/h
var
zoom
=
0.9
;
var
zoom
=
0.9
;
var
undo
=
Array
();
function
resize
(){
function
resize
(){
console
.
log
(
"resize"
);
console
.
log
(
"resize"
);
var
w
=
$
(
window
).
width
();
var
w
=
$
(
window
).
width
();
...
@@ -240,6 +242,20 @@ X3DOM Flash version is not available.<br/>\
...
@@ -240,6 +242,20 @@ X3DOM Flash version is not available.<br/>\
$
(
"#main"
).
append
(
rst_model
);
$
(
"#main"
).
append
(
rst_model
);
undo_model
=
$
(
"<button>"
,{
id
:
"undo_model"
}).
addClass
(
"btn-my btn nooutline"
).
html
(
"undo"
).
css
({
position
:
"absolute"
,
top
:
"3px"
,
left
:
"105px"
,
cursor
:
"pointer"
});
undo_model
.
click
(
function
(){
model_run_cmd
(
undo
[
undo
.
length
-
1
],
"click-int-all"
);
undo
.
pop
();
});
$
(
"#main"
).
append
(
undo_model
);
$
(
"#thrd"
).
css
({
$
(
"#thrd"
).
css
({
position
:
"absolute"
,
position
:
"absolute"
,
top
:
"3px"
,
top
:
"3px"
,
...
@@ -734,7 +750,7 @@ function mouseended(event){
...
@@ -734,7 +750,7 @@ function mouseended(event){
//deltat
//deltat
dt
=
last_state
.
timestamp
-
move_history
[
use_index
].
timestamp
;
dt
=
last_state
.
timestamp
-
move_history
[
use_index
].
timestamp
;
console
.
log
(
"Using samle #"
+
i
+
" behind="
+
(
move_history
.
length
-
i
)
+
" dist="
+
dist
+
" dt="
+
(
dt
/
1000
)
+
"s"
);
console
.
log
(
"Using sam
p
le #"
+
i
+
" behind="
+
(
move_history
.
length
-
i
)
+
" dist="
+
dist
+
" dt="
+
(
dt
/
1000
)
+
"s"
);
if
(
dt
==
0
)
{
if
(
dt
==
0
)
{
inertial_rot_axis_speed
=
[
new
x3dom
.
fields
.
SFVec3f
(
0
,
0
,
1
),
0
];
inertial_rot_axis_speed
=
[
new
x3dom
.
fields
.
SFVec3f
(
0
,
0
,
1
),
0
];
...
@@ -932,6 +948,8 @@ function update_info(name,state,cmd){
...
@@ -932,6 +948,8 @@ function update_info(name,state,cmd){
}
}
function
model_run_cmd
(
name
,
cmd
){
function
model_run_cmd
(
name
,
cmd
){
//undo = $.data(document.body, "main");
//undo = $("#x3d_canvas").clone();
var
state
=
""
;
var
state
=
""
;
if
(
name
!=
"reset"
){
if
(
name
!=
"reset"
){
state
=
$
(
"Switch[nsn="
+
name
+
"]"
).
attr
(
"state"
);
state
=
$
(
"Switch[nsn="
+
name
+
"]"
).
attr
(
"state"
);
...
@@ -939,6 +957,8 @@ function model_run_cmd(name,cmd){
...
@@ -939,6 +957,8 @@ function model_run_cmd(name,cmd){
}
}
switch
(
cmd
){
switch
(
cmd
){
case
"right-click"
:
case
"right-click"
:
//save to undo
undo
[
undo
.
length
]
=
name
;
//update status to "disabled"
//update status to "disabled"
$
(
"Switch[nsn="
+
name
+
"]"
).
attr
(
"state"
,
"disabled"
);
$
(
"Switch[nsn="
+
name
+
"]"
).
attr
(
"state"
,
"disabled"
);
//whichChoice -1
//whichChoice -1
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment