Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cto
g1
Commits
5fd9effa
Commit
5fd9effa
authored
Sep 25, 2018
by
S Anand
Browse files
BUG: FormHandler notification works without template. Fixes
#98
parent
ce251efd
Pipeline
#64974
passed with stage
in 2 minutes and 6 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
src/formhandler.js
View file @
5fd9effa
...
...
@@ -343,9 +343,7 @@ function actionHandler($this, options, template) {
var
arg
=
{
row
:
$
(
this
).
closest
(
'
[data-val]
'
).
data
(
'
val
'
),
index
:
$
(
this
).
closest
(
'
[data-row]
'
).
data
(
'
row
'
),
notify
:
function
(
message
)
{
$
(
'
.note
'
,
$this
).
html
(
template
[
'
error
'
]({
message
:
message
}))
}
notify
:
notify
.
bind
(
this
,
$this
,
template
)
}
var
action
=
$
(
this
).
data
(
'
action
'
)
...
...
@@ -368,12 +366,18 @@ String.prototype.remove_quotes = function () {
return
this
.
toString
().
replace
(
/
[
"'
]
/g
,
''
)
}
function
notify
(
$this
,
template
,
message
)
{
var
$note
=
$
(
'
.note
'
,
$this
)
if
(
!
$note
.
length
)
$note
=
$
(
'
<div class="note"></div>
'
).
appendTo
(
$this
)
$note
.
html
(
template
[
'
error
'
]({
message
:
message
}))
}
function
failHandler
(
$this
,
template
,
xhr
,
status
,
message
)
{
var
error
=
status
+
'
:
'
+
message
if
(
xhr
.
readyState
==
0
)
error
+=
'
(cannot connect to server)
'
$
(
'
.note
'
,
$this
).
html
(
template
[
'
error
'
]({
message
:
error
})
)
notify
(
$this
,
template
,
error
)
}
...
...
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