Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
dream
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
dream
Commits
0235a6b4
Commit
0235a6b4
authored
Dec 01, 2014
by
Ioannis Papagiannopoulos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ideas on how to solve back-to-first-bage buggy rendering
parent
a26fcb9f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
4 deletions
+42
-4
dream/platform/src/dream/inputModule_viewAddInstanceDefinitionDialog.html
...rc/dream/inputModule_viewAddInstanceDefinitionDialog.html
+6
-0
dream/platform/src/dream/inputModule_viewAddInstanceDefinitionDialog.js
.../src/dream/inputModule_viewAddInstanceDefinitionDialog.js
+36
-4
No files found.
dream/platform/src/dream/inputModule_viewAddInstanceDefinitionDialog.html
View file @
0235a6b4
...
...
@@ -7,6 +7,7 @@
<link
rel=
"stylesheet"
href=
"inputModule_viewAddInstanceDefinitionDialog.css"
/>
<script
src=
"../lib/rsvp.min.js"
type=
"text/javascript"
></script>
<script
src=
"../<%= copy.handlebars.relative_dest %>"
type=
"text/javascript"
></script>
<script
src=
"../lib/renderjs.min.js"
type=
"text/javascript"
></script>
<script
src=
"mixin_gadget.js"
type=
"text/javascript"
></script>
<script
src=
"mixin_promise.js"
type=
"text/javascript"
></script>
...
...
@@ -20,6 +21,11 @@
{{/documentlist}}
</ul>
</script-->
<!--script id="li-template" type="text/x-handlebars-template">
<div class="ui-btn ui-input-btn ui-corner-all ui-shadow"> {{value}}
<input type="submit" value="{{value}}" name= "{{name}}">
</div>
</script-->
</head>
<body>
...
...
dream/platform/src/dream/inputModule_viewAddInstanceDefinitionDialog.js
View file @
0235a6b4
/*global $, rJS, RSVP, promiseEventListener, promiseReadAsText,
initGadgetMixin, console */
initGadgetMixin,
Handlebars,
console */
(
function
(
window
,
rJS
,
RSVP
,
promiseEventListener
,
promiseReadAsText
,
initGadgetMixin
)
{
promiseReadAsText
,
initGadgetMixin
)
{
/* Handlebars*/
"
use strict
"
;
// delete last session document
function
removeLastSession
(
gadget
,
name
)
{
...
...
@@ -172,6 +172,11 @@
}
var
gadget_klass
=
rJS
(
window
);
//var gadget_klass = rJS(window),
// source = gadget_klass.__template_element
// .getElementById("li-template")
// .innerHTML,
// li_template = Handlebars.compile(source);
initGadgetMixin
(
gadget_klass
);
gadget_klass
.
declareAcquiredMethod
(
"
aq_post
"
,
"
jio_post
"
)
/////////////////////////////////////////////////////////////////
...
...
@@ -199,18 +204,29 @@
gadget
.
state_parameter_dict
=
{};
})
.
declareMethod
(
"
render
"
,
function
()
{
console
.
log
(
"
VIEWADDINSTANCE RENDER 1
"
);
var
gadget
,
doc_list
;
gadget
=
this
;
doc_list
=
gadget
.
props
.
element
.
querySelector
(
"
ul.document-list
"
);
// helper: add options to selects
function
makeListItems
(
row_list
)
{
var
i
,
len
,
fragment
,
item
,
record
,
button
,
box
,
label
;
/*text_node*/
console
.
log
(
"
MAKEDOCUMENTLIST 1
"
);
var
i
,
len
,
fragment
,
record
,
item
,
button
,
box
,
label
;
//test;
fragment
=
document
.
createDocumentFragment
();
for
(
i
=
0
,
len
=
row_list
.
length
;
i
<
len
;
i
+=
1
)
{
record
=
row_list
[
i
].
doc
;
item
=
document
.
createElement
(
"
li
"
);
//test = document.createElement("li");
/*jslint nomen: true*/
//test.innerHTML = li_template({
// value: record.title + " (" + record.date + ")",
// name: "record_" + record._id
//});
/*jslint nomen: false*/
button
=
document
.
createElement
(
"
input
"
);
button
.
type
=
"
submit
"
;
button
.
value
=
record
.
title
+
"
(
"
+
record
.
date
+
"
)
"
;
...
...
@@ -218,6 +234,7 @@
button
.
setAttribute
(
"
name
"
,
"
record_
"
+
record
.
_id
);
/*jslint nomen: false*/
label
=
document
.
createElement
(
"
label
"
);
box
=
document
.
createElement
(
"
input
"
);
box
.
type
=
"
checkbox
"
;
...
...
@@ -227,10 +244,14 @@
/*jslint nomen: false*/
label
.
appendChild
(
box
);
//test.appendChild(label);
item
.
appendChild
(
button
);
item
.
appendChild
(
label
);
fragment
.
appendChild
(
item
);
}
console
.
log
(
"
MAKEDOCUMENTLIST 2
"
);
return
fragment
;
}
// helper: select a configuration dictionary from a doc
...
...
@@ -240,7 +261,12 @@
//prevent default
e
.
preventDefault
();
form
=
e
.
target
;
console
.
log
(
'
HANDLEDICTSELECT
'
);
console
.
log
(
form
);
element
=
form
.
querySelector
(
"
div.ui-focus
"
);
if
(
element
===
undefined
||
null
)
{
element
=
form
.
querySelector
(
"
input.ui-state-focus
"
);
}
id
=
element
.
childNodes
[
1
].
name
.
replace
(
"
record_
"
,
""
);
return
gadget
.
aq_getAttachment
({
"
_id
"
:
id
,
...
...
@@ -307,6 +333,7 @@
"
select_list
"
:
[
"
title
"
,
"
modified
"
]
})
.
push
(
function
(
document_list
)
{
console
.
log
(
"
VIEWADDINSTANCE RENDER 2
"
);
var
len
,
data
,
$doc
,
fragment
;
data
=
document_list
.
data
;
len
=
data
.
total_rows
;
...
...
@@ -328,6 +355,7 @@
}
})
.
push
(
function
()
{
console
.
log
(
"
VIEWADDINSTANCE RENDER 3
"
);
if
(
!
gadget
.
state_parameter_dict
.
bound
)
{
gadget
.
state_parameter_dict
.
bound
=
true
;
return
RSVP
.
all
([
...
...
@@ -347,19 +375,23 @@
});
/*.fail(console.log);*/
})
.
declareMethod
(
"
startService
"
,
function
()
{
console
.
log
(
"
VIEWADDINSTANCE STARTSERVICE 1
"
);
var
gadget
=
this
;
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
console
.
log
(
"
VIEWADDINSTANCE STARTSERVICE 2
"
);
return
RSVP
.
any
([
waitForImport
(
gadget
),
waitForDefault
(
gadget
)
]);
})
.
push
(
function
(
result
)
{
console
.
log
(
"
VIEWADDINSTANCE STARTSERVICE 3
"
);
return
gadget
.
whoWantsToDisplayThisDocument
(
result
[
0
].
id
);
})
.
push
(
function
(
url
)
{
console
.
log
(
"
VIEWADDINSTANCE STARTSERVICE 4
"
);
return
gadget
.
pleaseRedirectMyHash
(
url
);
});
});
}(
window
,
rJS
,
RSVP
,
promiseEventListener
,
promiseReadAsText
,
initGadgetMixin
));
\ No newline at end of file
initGadgetMixin
));
/* Handlebars*/
\ No newline at end of file
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