HTMLSubmitCancelButtons.js 867 B

123456789101112131415161718192021222324252627282930313233343536
  1. define( function() {
  2. "use strict";
  3. function Control()
  4. {
  5. };
  6. Control.prototype.draw = function( oControlHost )
  7. {
  8. oControlHost.container.innerHTML =
  9. '<style>' +
  10. '.MyPromptButton' +
  11. '{' +
  12. 'background-color: white;' +
  13. 'border: 2px solid #4178BE;' +
  14. 'color: #4178be;' +
  15. 'font-size: 14px;' +
  16. 'height: 32px;' +
  17. 'width: 120px;' +
  18. 'margin-left: 20px;' +
  19. 'cursor: pointer;' +
  20. '} ' +
  21. '.MyPromptButton:hover' +
  22. '{' +
  23. 'background-color: #4178BE;' +
  24. 'color: white;' +
  25. '}' +
  26. '</style>' +
  27. '<button class="MyPromptButton btn1">Submit</button>' +
  28. '<button class="MyPromptButton btn2">Cancel</button>';
  29. oControlHost.container.querySelector( ".btn1" ).onclick = oControlHost.finish.bind( oControlHost );
  30. oControlHost.container.querySelector( ".btn2" ).onclick = oControlHost.cancel.bind( oControlHost );
  31. };
  32. return Control;
  33. });