Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
brainfood
/
rivets-error-binder
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
cae155ef
authored
2016-06-03 12:54:48 -0500
by
Adam Heath
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Add a feature to use a Backbone.View as the rendering implementation.
1 parent
e3afa8bb
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
3 deletions
bower.json
package.json
src/scripts/rivets-error-binder.js
bower.json
View file @
cae155e
{
"name"
:
"rivets-error-binder"
,
"version"
:
"0.
1.3
"
,
"version"
:
"0.
2.0
"
,
"authors"
:
[
"Adam Heath <doogie@brainfood.com>"
],
...
...
package.json
View file @
cae155e
{
"name"
:
"rivets-error-binder"
,
"version"
:
"0.
1.3
"
,
"version"
:
"0.
2.0
"
,
"main"
:
[
"src/scripts/rivets-error-binder.js"
],
...
...
src/scripts/rivets-error-binder.js
View file @
cae155e
...
...
@@ -9,7 +9,23 @@ define(function(require) {
binder
[
methodName
].
apply
(
binding
,
args
);
};
var
render
=
function
()
{
var
render
=
function
(
el
,
cmd
,
errorList
)
{
var
viewClassPath
=
module
.
config
().
viewClassPath
;
if
(
viewClassPath
)
{
var
$el
=
$
(
el
);
var
view
=
$el
.
data
(
'error-view'
);
if
(
view
===
undefined
&&
cmd
===
'bind'
)
{
$el
.
data
(
'error-view'
,
null
);
require
([
viewClassPath
],
function
(
ViewClass
)
{
$el
.
data
(
'error-view'
,
new
ViewClass
({
el
:
el
}));
});
return
;
}
if
(
view
)
{
view
.
errorCallback
(
cmd
,
errorList
);
}
return
;
}
var
renderImpl
=
module
.
config
().
render
;
if
(
renderImpl
)
{
return
renderImpl
.
apply
(
this
,
arguments
);
...
...
Please
register
or
sign in
to post a comment