ui.scheduler.current_time_shader.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. /**
  2. * DevExtreme (ui/scheduler/shaders/ui.scheduler.current_time_shader.js)
  3. * Version: 19.1.16
  4. * Build date: Tue Oct 18 2022
  5. *
  6. * Copyright (c) 2012 - 2022 Developer Express Inc. ALL RIGHTS RESERVED
  7. * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
  8. */
  9. "use strict";
  10. var $ = require("../../../core/renderer");
  11. var Class = require("../../../core/class");
  12. var DATE_TIME_SHADER_CLASS = "dx-scheduler-date-time-shader";
  13. var currentTimeShader = Class.inherit({
  14. render: function(workspace) {
  15. var _this = this;
  16. this._workspace = workspace;
  17. this._$container = workspace._dateTableScrollable.$content();
  18. this._$shader = this._createShader();
  19. this._shader = [];
  20. this._shader.push(this._$shader);
  21. this._renderShader();
  22. if (this._$shader && this._workspace.option("crossScrollingEnabled")) {
  23. this._$shader.css("marginTop", -this._$container.get(0).getBoundingClientRect().height);
  24. this._$shader.css("height", this._$container.get(0).getBoundingClientRect().height)
  25. }
  26. this._shader.forEach(function(shader, index) {
  27. _this._$container.append(shader)
  28. })
  29. },
  30. _createShader: function() {
  31. return $("<div>").addClass(DATE_TIME_SHADER_CLASS)
  32. },
  33. clean: function() {
  34. this._$container && this._$container.find("." + DATE_TIME_SHADER_CLASS).remove()
  35. }
  36. });
  37. module.exports = currentTimeShader;