API Docs for: 1.0.0
Show:

File: Resources/public/js/views/ez-studiopresentationview.js

  1. /*
  2. * Copyright (C) eZ Systems AS. All rights reserved.
  3. * For full copyright and license information view LICENSE file distributed with this source code.
  4. */
  5. YUI.add('ez-studiopresentationview', function (Y) {
  6. "use strict";
  7. /**
  8. * Provides the Studio Presentation View class
  9. *
  10. * @module ez-studiopresentationview
  11. */
  12. Y.namespace('eZ');
  13.  
  14. /**
  15. * The studio presentation view
  16. *
  17. * @namespace eZ
  18. * @class StudioPresentationView
  19. * @constructor
  20. * @extends eZ.TemplateBasedView
  21. */
  22. Y.eZ.StudioPresentationView = Y.Base.create('studioPresentationView', Y.eZ.TemplateBasedView, [Y.eZ.HeightFit], {
  23.  
  24. initializer: function () {
  25. this.after('activeChange', this._setIFrameSource);
  26. },
  27.  
  28. /**
  29. * Renders the studio presentation view
  30. *
  31. * @method render
  32. * @return {eZ.StudioPresentationView} the view itself
  33. */
  34. render: function () {
  35. this.get('container').setHTML(this.template());
  36. this._attachedViewEvents.push(Y.on("windowresize", Y.bind(this._uiSetHeight, this, 0)));
  37.  
  38. return this;
  39. },
  40.  
  41. /**
  42. * Sets the source of the iframe to the value of the iframeSource attribute.
  43. *
  44. * @method _setIFrameSource
  45. * @private
  46. */
  47. _setIFrameSource: function () {
  48. this.get('container').one('.ez-studiopresentation-content').set('src', this.get('iframeSource'));
  49. }
  50.  
  51. }, {
  52. ATTRS: {
  53. /**
  54. * Stores the iframe Source
  55. *
  56. * @attribute iframeSource
  57. * @type String
  58. * @default 'http://ez.no/in-product-studio-teaser'
  59. * @readOnly
  60. */
  61. iframeSource: {
  62. value: '//ez.no/in-product-studio-teaser',
  63. readOnly: true,
  64. },
  65. },
  66. });
  67. });
  68.