-
-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
separate flex example from main demo page
- Loading branch information
GuyR
committed
Aug 15, 2016
1 parent
ae07daa
commit f11fc07
Showing
4 changed files
with
37 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,29 @@ | ||
define(['react', 'lodash', './demoText', './firstComp.rt'], function (React, _, demoText, template) { | ||
'use strict'; | ||
|
||
function getParameterByName(name) { | ||
var url = window.location.href; | ||
name = name.replace(/[\[\]]/g, '\\$&'); | ||
var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'), | ||
results = regex.exec(url); | ||
if (!results) { | ||
return null; | ||
} | ||
if (!results[2]) { | ||
return false; | ||
} | ||
return decodeURIComponent(results[2].replace(/\+/g, ' ')); | ||
} | ||
|
||
|
||
return React.createClass({ | ||
displayName: 'firstComp', | ||
getText: function () { | ||
return demoText.text; | ||
}, | ||
isFlexExample: function () { | ||
return getParameterByName('flex'); | ||
}, | ||
render: template | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters