API Docs for: 1.0.0
Show:

File: Resources/public/js/apps/plugins/ez-contentpeekplugin.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-contentpeekplugin', function (Y) {
  6. "use strict";
  7. /**
  8. * Provides the content peek plugin
  9. *
  10. * @module ez-contentpeekplugin
  11. */
  12. Y.namespace('eZ.Plugin');
  13.  
  14. /**
  15. * The content peek plugin. It's a plugin for the application to set up the
  16. * `contentPeekOpen` and `contentPeekClose` event handlers.
  17. *
  18. * @namespace eZ.Plugin
  19. * @class ContentPeek
  20. * @constructor
  21. * @extends Plugin.Base
  22. */
  23. Y.eZ.Plugin.ContentPeek = Y.Base.create('contentPeekPlugin', Y.Plugin.Base, [], {
  24. initializer: function () {
  25. var app = this.get('host');
  26.  
  27. app.on('*:contentPeekOpen', function (e) {
  28. var config = e.config;
  29.  
  30. if ( !config.languageCode ) {
  31. config.languageCode = config.content.get('mainLanguageCode');
  32. }
  33. app.showSideView('contentPeek', e.config);
  34. });
  35.  
  36. app.on('*:contentPeekClose', function (e) {
  37. app.hideSideView('contentPeek');
  38. });
  39. },
  40. }, {
  41. NS: 'contentPeek',
  42. });
  43.  
  44. Y.eZ.PluginRegistry.registerPlugin(
  45. Y.eZ.Plugin.ContentPeek, ['platformuiApp']
  46. );
  47. });
  48.