course_wizard.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * Copyright (C) 2014 - present Instructure, Inc.
  3. *
  4. * This file is part of Canvas.
  5. *
  6. * Canvas is free software: you can redistribute it and/or modify it under
  7. * the terms of the GNU Affero General Public License as published by the Free
  8. * Software Foundation, version 3 of the License.
  9. *
  10. * Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
  11. * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  12. * A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
  13. * details.
  14. *
  15. * You should have received a copy of the GNU Affero General Public License along
  16. * with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. import $ from 'jquery'
  19. import React from 'react'
  20. import ReactDOM from 'react-dom'
  21. import CourseWizard from 'jsx/course_wizard/CourseWizard'
  22. /*
  23. * This essentially handles binding the button events and calling out to the
  24. * CourseWizard React component that is the actual wizard.
  25. */
  26. const $wizard_box = $('#wizard_box')
  27. $('.wizard_popup_link').click((event) => {
  28. ReactDOM.render(
  29. <CourseWizard overlayClassName="CourseWizard__modalOverlay" showWizard />,
  30. $wizard_box[0]
  31. )
  32. })
  33. // We are currently not allowing the wizard to popup automatically,
  34. // uncommenting the following code will re-enable that functionality.
  35. //
  36. // setTimeout( ->
  37. // if (!userSettings.get('hide_wizard_' + pathname))
  38. // $(".wizard_popup_link.auto_open:first").click()
  39. // , 500)