Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
449985ba
Commit
449985ba
authored
Feb 17, 2015
by
Son Nguyen
Browse files
Fix the bug in the behat step "I wait until the page is ready"
Bug 1422498 Change-Id: I3eec78722856eaac9d492cf93eaff7f39520ce94
parent
6b30d1de
Changes
3
Hide whitespace changes
Inline
Side-by-side
htdocs/js/mahara.js
View file @
449985ba
...
...
@@ -152,6 +152,12 @@ function displayMessage(message, type, hideprevmsg) {
}
}
/**
* This variable determines the completeness of a json request
* = true if the request is still in progress
*/
var
isRequestStillProcessing
=
false
;
/* Display a nice little loading notification */
function
processingStart
(
msg
)
{
if
(
!
msg
)
{
...
...
@@ -163,11 +169,15 @@ function processingStart(msg) {
DIV
(
msg
)
);
showElement
(
'
loading-box
'
);
isRequestStillProcessing
=
true
;
}
/* Hide the loading notification */
function
processingStop
()
{
hideElement
(
'
loading-box
'
);
isRequestStillProcessing
=
false
;
}
// End message related functions
...
...
htdocs/lib/pieforms/static/core/pieforms.js
View file @
449985ba
...
...
@@ -139,8 +139,6 @@ PieformManager = new PieformManager();
*/
function
Pieform
(
data
)
{
//{{{
var
self
=
this
;
this
.
SUBMITTING
=
0
;
this
.
COMPLETE
=
1
;
this
.
init
=
function
()
{
//{{{
if
(
self
.
data
.
checkDirtyChange
)
{
...
...
@@ -152,7 +150,6 @@ function Pieform(data) {//{{{
}
//}}}
this
.
processForm
=
function
(
e
)
{
//{{{
self
.
updateStatus
(
self
.
SUBMITTING
);
PieformManager
.
signal
(
'
onsubmit
'
,
self
.
data
.
name
);
// Call the presubmit callback, if there is one
...
...
@@ -184,7 +181,6 @@ function Pieform(data) {//{{{
// If canceling the form, redirect away
if
(
data
.
returnCode
==
-
2
)
{
window
.
location
=
data
.
location
;
self
.
updateStatus
(
self
.
COMPLETE
);
return
;
}
...
...
@@ -262,8 +258,6 @@ function Pieform(data) {//{{{
&&
self
.
data
.
postSubmitCallback
!=
''
)
{
window
[
self
.
data
.
postSubmitCallback
](
$
(
self
.
data
.
name
),
self
.
clickedButton
,
e
);
}
self
.
updateStatus
(
self
.
COMPLETE
);
}
}
//}}}
...
...
@@ -299,30 +293,6 @@ function Pieform(data) {//{{{
});
}
//}}}
/**
* Update the status of processing pieform.
*
* @return Boolean - True if succeeded
*/
this
.
updateStatus
=
function
(
status
)
{
if
(
self
.
data
.
name
!==
false
)
{
switch
(
status
)
{
case
self
.
SUBMITTING
:
SubmittingPieforms
.
push
(
self
.
data
.
name
);
return
true
;
break
;
case
self
.
COMPLETE
:
var
index
=
SubmittingPieforms
.
indexOf
(
self
.
data
.
name
);
if
(
index
>=
0
)
{
SubmittingPieforms
.
splice
(
index
,
1
);
return
true
;
}
break
;
}
}
return
false
;
};
// A reference to the iframe that submissions are made through
this
.
iframe
=
null
;
...
...
@@ -335,9 +305,3 @@ function Pieform(data) {//{{{
addLoadEvent
(
self
.
init
);
}
//}}}
/**
* @var SubmittingPieforms - The keys are the list of all submitting pieforms.
* @type Object
*/
SubmittingPieforms
=
[];
htdocs/testing/frameworks/behat/classes/BehatBase.php
View file @
449985ba
...
...
@@ -53,7 +53,7 @@ class BehatBase extends Behat\MinkExtension\Context\RawMinkContext {
/**
* The JS code to check that the page is ready.
*/
const
PAGE_READY_JS
=
'(
SubmittingPieforms && SubmittingPieforms.length === 0
) && (document.readyState === "complete")'
;
const
PAGE_READY_JS
=
'(
isRequestStillProcessing === false
) && (document.readyState === "complete")'
;
/**
* @var Escaper
...
...
Write
Preview
Supports
Markdown
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