Skip to content

Commit

Permalink
An example extedned Hyrax JS class
Browse files Browse the repository at this point in the history
  • Loading branch information
little9 committed Jun 6, 2017
1 parent 7962bce commit d872f6f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
7 changes: 7 additions & 0 deletions app/assets/javascripts/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Hyrax.admin = () => {
var AdminSetControls = require('hyrax/admin/admin_set_controls')
var MyAdminSetControls = require('my_admin_set_controls')
var controls = new MyAdminSetControls($('#admin-set-controls'))
console.log("Init'ng my controls")
}

3 changes: 2 additions & 1 deletion app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
// Required by Blacklight
//= require blacklight/blacklight

//= require_tree .
//= require hyrax

// require almond
//= require_tree .
8 changes: 8 additions & 0 deletions app/assets/javascripts/my_admin_set_controls.es6
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import AdminSetControls from 'hyrax/admin/admin_set_controls'
export default class MyAdminSetControls extends AdminSetControls {
constructor(elem) {
super(elem)
console.log("this is an extended adminsetcontrols")
}

}

0 comments on commit d872f6f

Please sign in to comment.