Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
renderjs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Cédric Le Ninivin
renderjs
Commits
81140f2f
Commit
81140f2f
authored
Apr 22, 2014
by
Thibaut Frain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure root gadget __path attribute do not contain hash
parent
9d520789
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
4 deletions
+25
-4
renderjs.js
renderjs.js
+9
-1
test/renderjs_test.js
test/renderjs_test.js
+16
-3
No files found.
renderjs.js
View file @
81140f2f
...
...
@@ -15,6 +15,14 @@
loading_gadget_promise
,
renderJS
;
function
removeHash
(
url
)
{
var
index
=
url
.
indexOf
(
'
#
'
);
if
(
index
>
0
)
{
url
=
url
.
substring
(
0
,
index
);
}
return
url
;
}
/////////////////////////////////////////////////////////////////
// RenderJSGadget
/////////////////////////////////////////////////////////////////
...
...
@@ -704,7 +712,7 @@
///////////////////////////////////////////////////
function
bootstrap
()
{
var
url
=
window
.
location
.
href
,
var
url
=
removeHash
(
window
.
location
.
href
)
,
tmp_constructor
,
root_gadget
,
declare_method_count
=
0
,
...
...
test/renderjs_test.js
View file @
81140f2f
...
...
@@ -2769,7 +2769,18 @@
parent_path
=
URI
.
build
({
protocol
:
parsed
.
protocol
,
hostname
:
parsed
.
hostname
,
port
:
parsed
.
port
,
path
:
parsed
.
path
}).
toString
();
path
:
parsed
.
path
}).
toString
(),
root_gadget_path_without_hash
,
hash_index
;
window
.
location
.
hash
=
'
testHash
'
;
hash_index
=
window
.
location
.
href
.
indexOf
(
'
#
'
);
if
(
hash_index
>
0
)
{
root_gadget_path_without_hash
=
window
.
location
.
href
.
substring
(
0
,
hash_index
);
}
else
{
root_gadget_path_without_hash
=
window
.
location
.
href
;
}
root_gadget_klass
.
declareAcquiredMethod
(
'
getTopURL
'
,
'
getTopURL
'
)
...
...
@@ -2785,7 +2796,8 @@
root_gadget_defer
.
promise
.
then
(
function
(
root_gadget
)
{
// Check instance
equal
(
root_gadget
.
__path
,
window
.
location
.
href
);
equal
(
root_gadget
.
__path
,
root_gadget_path_without_hash
);
equal
(
typeof
root_gadget
.
__acquired_method_dict
,
'
object
'
);
equal
(
Object
.
keys
(
root_gadget
.
__acquired_method_dict
).
length
,
1
);
equal
(
root_gadget
.
__title
,
document
.
title
);
...
...
@@ -2809,7 +2821,8 @@
]);
equal
(
root_gadget
.
__element
.
outerHTML
,
document
.
body
.
outerHTML
);
// Check klass
equal
(
root_gadget
.
constructor
.
prototype
.
__path
,
window
.
location
.
href
);
equal
(
root_gadget
.
constructor
.
prototype
.
__path
,
root_gadget_path_without_hash
);
equal
(
root_gadget
.
constructor
.
prototype
.
__title
,
document
.
title
);
deepEqual
(
root_gadget
.
constructor
.
prototype
.
__interface_list
,
[]);
deepEqual
(
root_gadget
.
constructor
.
prototype
.
__required_css_list
,
...
...
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