LinkPane.js.uncompressed.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. define("dijit/layout/LinkPane", [
  2. "./ContentPane",
  3. "../_TemplatedMixin",
  4. "dojo/_base/declare" // declare
  5. ], function(ContentPane, _TemplatedMixin, declare){
  6. // module:
  7. // dijit/layout/LinkPane
  8. return declare("dijit.layout.LinkPane", [ContentPane, _TemplatedMixin], {
  9. // summary:
  10. // A ContentPane with an href where (when declared in markup)
  11. // the title is specified as innerHTML rather than as a title attribute.
  12. // description:
  13. // LinkPane is just a ContentPane that is declared in markup similarly
  14. // to an anchor. The anchor's body (the words between `<a>` and `</a>`)
  15. // become the title of the widget (used for TabContainer, AccordionContainer, etc.)
  16. // example:
  17. // | <a href="foo.html">my title</a>
  18. // I'm using a template because the user may specify the input as
  19. // <a href="foo.html">title</a>, in which case we need to get rid of the
  20. // <a> because we don't want a link.
  21. templateString: '<div class="dijitLinkPane" data-dojo-attach-point="containerNode"></div>',
  22. postMixInProperties: function(){
  23. // If user has specified node contents, they become the title
  24. // (the link must be plain text)
  25. if(this.srcNodeRef){
  26. this.title += this.srcNodeRef.innerHTML;
  27. }
  28. this.inherited(arguments);
  29. },
  30. _fillContent: function(){
  31. // Overrides _Templated._fillContent().
  32. // _Templated._fillContent() relocates srcNodeRef innerHTML to templated container node,
  33. // but in our case the srcNodeRef innerHTML is the title, so shouldn't be
  34. // copied
  35. }
  36. });
  37. });