Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

Commit cff978a

Browse files
authored
chore(plunker): open in embedded-style by default (#2884)
Added "flat-style" attribute option if you prefer to force a plunker into the original, flat editor style
1 parent fd9a331 commit cff978a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

public/resources/js/directives/live-example.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* [plnkr='...']
1111
* [noSource]
1212
* [embedded]
13-
* [embedded-style]
13+
* [embedded-style | flat-style]
1414
* [srcText="..."]
1515
* [title="..."]>text</live-example>
1616
* Example:
@@ -38,6 +38,10 @@
3838
* <live-example embedded-style>this example</live-example>
3939
* // ~/resources/live-examples/{page}//ts/eplnkr.html
4040
*
41+
* // Links to a *new* tab in the flat (original editor) style plunker editor
42+
* <live-example flat-style>this example</live-example>
43+
* // ~/resources/live-examples/{page}//ts/eplnkr.html
44+
*
4145
* // Displays in *same* tab as an embedded style plunker editor
4246
* <live-example name="toh-1" embedded plnkr="minimal" img="toh>Tour of Heroes - Part 1</live-example>
4347
* // ~/resources/live-examples/toh-1/ts/minimal.eplnkr.html
@@ -68,8 +72,9 @@ angularIO.directive('liveExample', ['$location', function ($location) {
6872
if (attrs['title'] == undefined) { tElement[0].setAttribute('title', text); } // set default title (tooltip)
6973
var ex = attrs.name || NgIoUtil.getExampleName($location);
7074
var embedded = attrs.hasOwnProperty('embedded');
75+
var flatStyle = attrs.hasOwnProperty('flatstyle') || attrs.hasOwnProperty('flatStyle');
7176
var embeddedStyle = embedded || attrs.hasOwnProperty('embeddedstyle') || attrs.hasOwnProperty('embeddedStyle');
72-
var plnkr = embeddedStyle ? 'eplnkr' : 'plnkr';
77+
var plnkr = (embeddedStyle || !flatStyle) ? 'eplnkr' : 'plnkr';
7378
var imageBase = '/resources/images/';
7479
var defaultImg = 'plunker/placeholder.png';
7580

0 commit comments

Comments
 (0)