Compare commits

...
18 Commits
Author SHA1 Message Date
Mike Grabowski a3268f7dd1 [0.27.2] Bump version numbers 2016-06-09 01:52:24 +02:00
Mike Grabowski 8abca24268 Add Keyboard to exported APIs 2016-06-09 01:43:54 +02:00
Martin Konicek 8074b09e7d [0.27.1] Bump version numbers 2016-06-07 00:58:08 +01:00
Andrej Badin a6b8110528 Fix scrolling issue on iOS devices.
Summary:
It was not possible to scroll due to overlaying (and visually not present) docs navigation layer.

Fixes issue introduced in PR #7669, see this [comment](https://github.com/facebook/react-native/pull/7669#issuecomment-220784882)
Additionally, script makes sure only single target is "in" and closes any other target with "in" state.
Closes https://github.com/facebook/react-native/pull/7731

Differential Revision: D3344927

Pulled By: vjeux

fbshipit-source-id: b2c64d90a2a6e531a9be79b936d6a5da61a69b22
2016-06-07 00:54:16 +01:00
Ben Alpert 877df8cb1a Change survey image
Reviewed By: vjeux

Differential Revision: D3362968

fbshipit-source-id: f6de18a5f27e32e6bb64a65bc233d741cb276f41
2016-06-07 00:54:11 +01:00
Andrej Badin fe189c18aa Improve Navigation panel column layout for landscape/portrait
Summary:
Improve column layout for _phone vs. tablet_ & _portrait vs landscape_ variations.
This change only affects handheld devices, or devices with really small (physical) screen dimensions.

See previews bellow:

Phone - landscape
![phone-landscape](https://cloud.githubusercontent.com/assets/829963/15448311/53863428-1f5e-11e6-9e05-d98587b9752f.png)

Phone - portrait
![phone-portrait](https://cloud.githubusercontent.com/assets/829963/15448309/5385eb9e-1f5e-11e6-8d12-6bda7e1d2e7f.png)

Tablet - landscape
![tablet-landscape](https://cloud.githubusercontent.com/assets/829963/15448312/538719a6-1f5e-11e6-9a2c-52d0c9109f09.png)

Tablet - portrait
![tablet-portrait](https://cloud.githubusercontent.com/assets/829963/15448310/53862636-1f5e-11e6-87ff-727568d7dd1f.png)
Closes https://github.com/facebook/react-native/pull/7669

Differential Revision: D3332676

Pulled By: vjeux

fbshipit-source-id: 8cfc1903e35fd62c82fcd8dd1e05a1e2062c555d
2016-06-07 00:54:02 +01:00
Mike Grabowski 37cc5cfb0c [0.27.0] Bump version numbers 2016-06-06 10:21:36 +02:00
Eloy Durán 41fa6e7f45 Add C++ and standard v14 settings.
Summary:
This PR adds the C++ stdlib to the linker flags and sets the C++ standard that’s used to v14.

I have tested this with my app, without it any CP build would fail unless users add those flags to the generated projects themselves.

/cc grabbou
Closes https://github.com/facebook/react-native/pull/7800

Differential Revision: D3360421

fbshipit-source-id: 0a80030dd255f073a201acc6e1c846be114c2c2a
2016-06-06 10:19:25 +02:00
Konstantin Raev 8b734173d3 [0.27.0-rc3] Bump version numbers 2016-06-05 19:47:08 +01:00
Konstantin Raev 252102588d [0.27.0-rc.3] Bump version numbers 2016-06-05 17:19:23 +01:00
Martin Konicek 76003f3720 [0.27.0-rc2] Bump version numbers 2016-05-27 16:51:49 +01:00
Eric Rozell 3cabf4f98f Update node-haste dependency to 2.12.0
Summary:
Update to node-haste 2.12.0 to support pass through configuration of supported platforms.
Closes https://github.com/facebook/react-native/pull/7660

Differential Revision: D3335034

Pulled By: mkonicek

fbshipit-source-id: d238b90a90d51654301d61251ceb26d183fef57a
2016-05-27 16:42:19 +01:00
Mike Grabowski bbccdd5b84 [0.27.0-rc1] Bump version numbers 2016-05-25 02:26:29 +02:00
David Aurelio cacf6b1267 Respect original enumerability/writability when polyfilling globals
Summary:
Reuses the original property descriptor when overwriting / polyfilling globals to ensure enumerability and writability are the same
Closes https://github.com/facebook/react-native/pull/7704

Differential Revision: D3338119

Pulled By: davidaurelio

fbshipit-source-id: ab456324a3346cd3ec8b2c3e3a2378408c92087c
2016-05-25 01:55:58 +02:00
Konstantin Raev 934acd809d Made npm deployment to be independent of git tags cache
Summary:
Fixes npm deployment script as in https://circleci.com/gh/facebook/react-native/6745.

Example situation:
- admin is ready to release 0.26.0
- admin adds tag v0.26.0 and pushes to origin
- Circle CI build fails because of code error
- admin cherry-picks a fix and tags v0.26.0 again and pushes to origin
- Circle does not update local tag v0.26.0 because it already has it cached, compiles the code but fails to deploy to npm because v0.26.0 is not on branch HEAD from Circle point of view

The previous version of the script was checking the tags on current commit as well but it used the local branch tags.
This change fetches tags from `origin` fresh and allows us to redeploy the same version multiple times.
Closes https://github.com/facebook/react-native/pull/7619

Differential Revision: D3334469

fbshipit-source-id: b423fc19516dc4f5f7f2605224e62b8a378c8a7d
2016-05-25 01:53:59 +02:00
Marc Horowitz 24a806a9f1 Fix chrome debugging on android
Summary:
Java loadApplicationScript changed, but the C++ code in the
debug ProxyExecutor which called it did not.  This fixes the fbjni
method lookup.

fixes #7659

Reviewed By: AaaChiuuu

Differential Revision: D3331472

fbshipit-source-id: 33312dccc3c7687f51742e42f9e0397f9c925e76
2016-05-25 01:53:29 +02:00
James Ide 7d1b4d681a [React] Use React 15.1.0 and stop using the alpha 2016-05-23 11:16:31 -07:00
Mike Grabowski 0f9e31cce8 [0.27.0-rc] Bump version numbers 2016-05-20 20:23:00 +02:00
11 changed files with 180 additions and 113 deletions
@@ -64,40 +64,47 @@ function setUpConsole() {
* https://github.com/facebook/react-native/issues/934
*/
function polyfillGlobal(name, newValue, scope = global) {
const descriptor = Object.getOwnPropertyDescriptor(scope, name) || {
// jest for some bad reasons runs the polyfill code multiple times. In jest
// environment, XmlHttpRequest doesn't exist so getOwnPropertyDescriptor
// returns undefined and defineProperty default for writable is false.
// Therefore, the second time it runs, defineProperty will fatal :(
writable: true,
};
if (scope[name] !== undefined) {
const descriptor = Object.getOwnPropertyDescriptor(scope, name);
if (descriptor) {
const backupName = `original${name[0].toUpperCase()}${name.substr(1)}`;
Object.defineProperty(scope, backupName, {...descriptor, value: scope[name]});
}
Object.defineProperty(scope, name, {...descriptor, value: newValue});
}
const {enumerable, writable} = descriptor || {};
function polyfillLazyGlobal(name, valueFn, scope = global) {
if (scope[name] !== undefined) {
const descriptor = Object.getOwnPropertyDescriptor(scope, name);
const backupName = `original${name[0].toUpperCase()}${name.substr(1)}`;
Object.defineProperty(scope, backupName, {...descriptor, value: scope[name]});
}
// jest for some bad reasons runs the polyfill code multiple times. In jest
// environment, XmlHttpRequest doesn't exist so getOwnPropertyDescriptor
// returns undefined and defineProperty default for writable is false.
// Therefore, the second time it runs, defineProperty will fatal :(
Object.defineProperty(scope, name, {
configurable: true,
enumerable: true,
enumerable: enumerable !== false,
writable: writable !== false,
value: newValue,
});
}
function polyfillLazyGlobal(name, valueFn, scope = global) {
const descriptor = getPropertyDescriptor(scope, name);
if (descriptor) {
const backupName = `original${name[0].toUpperCase()}${name.substr(1)}`;
Object.defineProperty(scope, backupName, descriptor);
}
const {enumerable, writable} = descriptor || {};
Object.defineProperty(scope, name, {
configurable: true,
enumerable: enumerable !== false,
get() {
return (this[name] = valueFn());
},
set(value) {
Object.defineProperty(this, name, {
configurable: true,
enumerable: true,
value
enumerable: enumerable !== false,
writable: writable !== false,
value,
});
}
});
@@ -211,6 +218,16 @@ function setUpDevTools() {
}
}
function getPropertyDescriptor(object, name) {
while (object) {
const descriptor = Object.getOwnPropertyDescriptor(object, name);
if (descriptor) {
return descriptor;
}
object = Object.getPrototypeOf(object);
}
}
setUpProcess();
setUpConsole();
setUpTimers();
+1
View File
@@ -88,6 +88,7 @@ var ReactNative = {
get ImagePickerIOS() { return require('ImagePickerIOS'); },
get IntentAndroid() { return require('IntentAndroid'); },
get InteractionManager() { return require('InteractionManager'); },
get Keyboard() { return require('Keyboard'); },
get LayoutAnimation() { return require('LayoutAnimation'); },
get Linking() { return require('Linking'); },
get LinkingIOS() { return require('LinkingIOS'); },
+51 -49
View File
@@ -4,7 +4,7 @@ package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
Pod::Spec.new do |s|
s.name = "React"
s.version = package['version']
s.version = "0.27.2"
s.summary = package['description']
s.description = <<-DESC
React Native apps are built using the React JS
@@ -29,95 +29,97 @@ Pod::Spec.new do |s|
s.preserve_paths = "cli.js", "Libraries/**/*.js", "lint", "linter.js", "node_modules", "package.json", "packager", "PATENTS", "react-native-cli"
s.subspec 'Core' do |ss|
ss.source_files = "React/**/*.{c,h,m,mm,S}"
ss.exclude_files = "**/__tests__/*", "IntegrationTests/*"
ss.frameworks = "JavaScriptCore"
ss.source_files = "React/**/*.{c,h,m,mm,S}"
ss.exclude_files = "**/__tests__/*", "IntegrationTests/*"
ss.frameworks = "JavaScriptCore"
ss.libraries = "stdc++"
ss.pod_target_xcconfig = { "CLANG_CXX_LANGUAGE_STANDARD" => "c++14" }
end
s.subspec 'ART' do |ss|
ss.dependency 'React/Core'
ss.source_files = "Libraries/ART/**/*.{h,m}"
ss.preserve_paths = "Libraries/ART/**/*.js"
ss.dependency 'React/Core'
ss.source_files = "Libraries/ART/**/*.{h,m}"
ss.preserve_paths = "Libraries/ART/**/*.js"
end
s.subspec 'RCTActionSheet' do |ss|
ss.dependency 'React/Core'
ss.source_files = "Libraries/ActionSheetIOS/*.{h,m}"
ss.preserve_paths = "Libraries/ActionSheetIOS/*.js"
ss.dependency 'React/Core'
ss.source_files = "Libraries/ActionSheetIOS/*.{h,m}"
ss.preserve_paths = "Libraries/ActionSheetIOS/*.js"
end
s.subspec 'RCTAdSupport' do |ss|
ss.dependency 'React/Core'
ss.source_files = "Libraries/AdSupport/*.{h,m}"
ss.preserve_paths = "Libraries/AdSupport/*.js"
ss.dependency 'React/Core'
ss.source_files = "Libraries/AdSupport/*.{h,m}"
ss.preserve_paths = "Libraries/AdSupport/*.js"
end
s.subspec 'RCTCameraRoll' do |ss|
ss.dependency 'React/Core'
ss.dependency 'React/RCTImage'
ss.source_files = "Libraries/CameraRoll/*.{h,m}"
ss.preserve_paths = "Libraries/CameraRoll/*.js"
ss.dependency 'React/Core'
ss.dependency 'React/RCTImage'
ss.source_files = "Libraries/CameraRoll/*.{h,m}"
ss.preserve_paths = "Libraries/CameraRoll/*.js"
end
s.subspec 'RCTGeolocation' do |ss|
ss.dependency 'React/Core'
ss.source_files = "Libraries/Geolocation/*.{h,m}"
ss.preserve_paths = "Libraries/Geolocation/*.js"
ss.dependency 'React/Core'
ss.source_files = "Libraries/Geolocation/*.{h,m}"
ss.preserve_paths = "Libraries/Geolocation/*.js"
end
s.subspec 'RCTImage' do |ss|
ss.dependency 'React/Core'
ss.dependency 'React/RCTNetwork'
ss.source_files = "Libraries/Image/*.{h,m}"
ss.preserve_paths = "Libraries/Image/*.js"
ss.dependency 'React/Core'
ss.dependency 'React/RCTNetwork'
ss.source_files = "Libraries/Image/*.{h,m}"
ss.preserve_paths = "Libraries/Image/*.js"
end
s.subspec 'RCTNetwork' do |ss|
ss.dependency 'React/Core'
ss.source_files = "Libraries/Network/*.{h,m}"
ss.preserve_paths = "Libraries/Network/*.js"
ss.dependency 'React/Core'
ss.source_files = "Libraries/Network/*.{h,m}"
ss.preserve_paths = "Libraries/Network/*.js"
end
s.subspec 'RCTPushNotification' do |ss|
ss.dependency 'React/Core'
ss.source_files = "Libraries/PushNotificationIOS/*.{h,m}"
ss.preserve_paths = "Libraries/PushNotificationIOS/*.js"
ss.dependency 'React/Core'
ss.source_files = "Libraries/PushNotificationIOS/*.{h,m}"
ss.preserve_paths = "Libraries/PushNotificationIOS/*.js"
end
s.subspec 'RCTSettings' do |ss|
ss.dependency 'React/Core'
ss.source_files = "Libraries/Settings/*.{h,m}"
ss.preserve_paths = "Libraries/Settings/*.js"
ss.dependency 'React/Core'
ss.source_files = "Libraries/Settings/*.{h,m}"
ss.preserve_paths = "Libraries/Settings/*.js"
end
s.subspec 'RCTText' do |ss|
ss.dependency 'React/Core'
ss.source_files = "Libraries/Text/*.{h,m}"
ss.preserve_paths = "Libraries/Text/*.js"
ss.dependency 'React/Core'
ss.source_files = "Libraries/Text/*.{h,m}"
ss.preserve_paths = "Libraries/Text/*.js"
end
s.subspec 'RCTVibration' do |ss|
ss.dependency 'React/Core'
ss.source_files = "Libraries/Vibration/*.{h,m}"
ss.preserve_paths = "Libraries/Vibration/*.js"
ss.dependency 'React/Core'
ss.source_files = "Libraries/Vibration/*.{h,m}"
ss.preserve_paths = "Libraries/Vibration/*.js"
end
s.subspec 'RCTWebSocket' do |ss|
ss.dependency 'React/Core'
ss.source_files = "Libraries/WebSocket/*.{h,m}"
ss.preserve_paths = "Libraries/WebSocket/*.js"
ss.dependency 'React/Core'
ss.source_files = "Libraries/WebSocket/*.{h,m}"
ss.preserve_paths = "Libraries/WebSocket/*.js"
end
s.subspec 'RCTLinkingIOS' do |ss|
ss.dependency 'React/Core'
ss.source_files = "Libraries/LinkingIOS/*.{h,m}"
ss.preserve_paths = "Libraries/LinkingIOS/*.js"
ss.dependency 'React/Core'
ss.source_files = "Libraries/LinkingIOS/*.{h,m}"
ss.preserve_paths = "Libraries/LinkingIOS/*.js"
end
s.subspec 'RCTTest' do |ss|
ss.dependency 'React/Core'
ss.source_files = "Libraries/RCTTest/**/*.{h,m}"
ss.preserve_paths = "Libraries/RCTTest/**/*.js"
ss.frameworks = "XCTest"
ss.dependency 'React/Core'
ss.source_files = "Libraries/RCTTest/**/*.{h,m}"
ss.preserve_paths = "Libraries/RCTTest/**/*.js"
ss.frameworks = "XCTest"
end
end
+1 -1
View File
@@ -1,4 +1,4 @@
VERSION_NAME=1000.0.0-master
VERSION_NAME=0.27.2
GROUP=com.facebook.react
POM_NAME=ReactNative
@@ -41,14 +41,15 @@ ProxyExecutor::~ProxyExecutor() {
}
void ProxyExecutor::loadApplicationScript(
const std::string& script,
const std::string&,
const std::string& sourceURL) {
static auto loadApplicationScript =
jni::findClassStatic(EXECUTOR_BASECLASS)->getMethod<void(jstring, jstring)>("loadApplicationScript");
jni::findClassStatic(EXECUTOR_BASECLASS)->getMethod<void(jstring)>("loadApplicationScript");
// The proxy ignores the script data passed in.
loadApplicationScript(
m_executor.get(),
jni::make_jstring(script).get(),
jni::make_jstring(sourceURL).get());
}
+5 -5
View File
@@ -1,6 +1,6 @@
{
"name": "react-native",
"version": "1000.0.0",
"version": "0.27.2",
"description": "A framework for building native apps using React",
"license": "BSD-3-Clause",
"repository": {
@@ -126,7 +126,7 @@
"react-native": "local-cli/wrong-react-native.js"
},
"peerDependencies": {
"react": "15.1.0-alpha.1"
"react": "15.1.0"
},
"dependencies": {
"absolute-path": "^0.0.0",
@@ -158,7 +158,7 @@
"mkdirp": "^0.5.1",
"module-deps": "^3.9.1",
"node-fetch": "^1.3.3",
"node-haste": "~2.11.0",
"node-haste": "~2.12.0",
"opn": "^3.0.2",
"optimist": "^0.6.1",
"progress": "^1.1.8",
@@ -189,7 +189,7 @@
"flow-bin": "^0.25.0",
"jest-cli": "11.0.2",
"portfinder": "0.4.0",
"react": "^15.1.0-alpha.1",
"react": "15.1.0",
"shelljs": "0.6.0"
}
}
}
+9 -5
View File
@@ -51,7 +51,7 @@ class AssetServer {
}
get(assetPath, platform = null) {
const assetData = getAssetDataFromName(assetPath);
const assetData = getAssetDataFromName(assetPath, new Set([platform]));
return this._getAssetRecord(assetPath, platform).then(record => {
for (let i = 0; i < record.scales.length; i++) {
if (record.scales[i] >= assetData.resolution) {
@@ -64,7 +64,7 @@ class AssetServer {
}
getAssetData(assetPath, platform = null) {
const nameData = getAssetDataFromName(assetPath);
const nameData = getAssetDataFromName(assetPath, new Set([platform]));
const data = {
name: nameData.name,
type: nameData.type,
@@ -115,7 +115,7 @@ class AssetServer {
.then(res => {
const dir = res[0];
const files = res[1];
const assetData = getAssetDataFromName(filename);
const assetData = getAssetDataFromName(filename, new Set([platform]));
const map = this._buildAssetMap(dir, files, platform);
@@ -166,8 +166,8 @@ class AssetServer {
});
}
_buildAssetMap(dir, files) {
const assets = files.map(getAssetDataFromName);
_buildAssetMap(dir, files, platform) {
const assets = files.map(this._getAssetDataFromName.bind(this, new Set([platform])));
const map = Object.create(null);
assets.forEach(function(asset, i) {
const file = files[i];
@@ -194,6 +194,10 @@ class AssetServer {
return map;
}
_getAssetDataFromName(platform, file) {
return getAssetDataFromName(file, platform);
}
}
function getAssetKey(assetName, platform) {
+10 -5
View File
@@ -60,12 +60,17 @@ if (buildBranch.indexOf(`-stable`) !== -1) {
exit(0);
}
// ['latest', 'v0.33.0', 'v0.33.0-rc', 'v0.33.0-rc1', 'v0.33.0-rc2', 'v0.34.0', '']
const tagsWithVersion = exec(`git tag -l --points-at HEAD`).stdout.split(/\s/)
// ['v0.33.0', 'v0.33.0-rc', 'v0.33.0-rc1', 'v0.33.0-rc2', 'v0.34.0']
.filter(version => !!version && version.indexOf(`v${branchVersion}`) === 0)
// 34c034298dc9cad5a4553964a5a324450fda0385
const currentCommit = exec(`git rev-parse HEAD`, {silent: true}).stdout.trim();
// [34c034298dc9cad5a4553964a5a324450fda0385, refs/heads/0.33-stable, refs/tags/latest, refs/tags/v0.33.1, refs/tags/v0.34.1-rc]
const tagsWithVersion = exec(`git ls-remote origin | grep ${currentCommit}`, {silent: true})
.stdout.split(/\s/)
// ['refs/tags/v0.33.0', 'refs/tags/v0.33.0-rc', 'refs/tags/v0.33.0-rc1', 'refs/tags/v0.33.0-rc2', 'refs/tags/v0.34.0']
.filter(version => !!version && version.indexOf(`refs/tags/v${branchVersion}`) === 0)
// ['refs/tags/v0.33.0', 'refs/tags/v0.33.0-rc', 'refs/tags/v0.33.0-rc1', 'refs/tags/v0.33.0-rc2']
.filter(version => version.indexOf(branchVersion) !== -1)
// ['v0.33.0', 'v0.33.0-rc', 'v0.33.0-rc1', 'v0.33.0-rc2']
.filter(version => version.indexOf(branchVersion) !== -1);
.map(version => version.slice(`refs/tags/`.length));
if (tagsWithVersion.length === 0) {
echo(`Error: Can't find version tag in current commit. To deploy to NPM you must add tag v0.XY.Z[-rc] to your commit`);
+50 -22
View File
@@ -481,42 +481,53 @@ h1:hover .hash-link, h2:hover .hash-link, h3:hover .hash-link, h4:hover .hash-li
border-bottom: 0;
}
@media screen and (max-device-width: 960px) {
@media only screen and (max-device-width: 1024px) {
@-webkit-keyframes slide-in {
0% { top: -30px; opacity: 0; }
100% { top: 0; opacity: 1; }
}
@-moz-keyframes slide-in {
0% { top: -30px; opacity: 0; }
100% { top: 0; opacity: 1; }
}
@-o-keyframes slide-in {
0% { top: -30px; opacity: 0; }
100% { top: 0; opacity: 1; }
}
@keyframes slide-in {
0% { top: -30px; opacity: 0; }
100% { top: 0; opacity: 1; }
}
.nav-docs {
position: fixed;
z-index: 90;
top: 0;
top: -100%;
left: 0;
width: 100%;
height: 100%;
margin: 0;
padding: 53px 0 0 0;
background: #3B3738;
/* Transition these properties */
transition: opacity 0.3s, visibility 0.3s;
visibility: hidden;
opacity: 0;
}
.nav-docs-viewport {
border-top: 1px solid rgb(5, 165, 209);
height: 100%;
padding: 25px;
overflow: scroll;
-webkit-overflow-scrolling: touch;
top: -30px;
position: relative;
transition: top 0.3s;
width: 100%;
height: 100%;
}
/* Active state */
.nav-docs.in {
visibility: visible;
opacity: 1;
}
.nav-docs.in .nav-docs-viewport {
top: 0;
-webkit-animation: slide-in 0.3s forwards;
-moz-animation: slide-in 0.3s forwards;
-o-animation: slide-in 0.3s forwards;
animation: slide-in 0.3s forwards;
}
.nav-docs * {
@@ -555,18 +566,38 @@ h1:hover .hash-link, h2:hover .hash-link, h3:hover .hash-link, h4:hover .hash-li
}
}
@media screen and (min-device-width: 641px) and (max-device-width: 1024px) {
/**
* Multicolumn layout for phone (landscape only) & tablet (regardless its screen orientation)/
*/
@media only screen and (min-device-width : 375px) and (max-device-width : 1024px) {
.nav-docs-section ul {
display: flex;
flex-wrap: wrap;
}
/* Display 2 columns on tablet */
.nav-docs-section li {
width: 100%;
}
}
/* 2 columns layout */
@media
/*Phone, landscape screen orientation*/
only screen and (min-device-width : 375px) and (max-device-width : 1024px) and (orientation : landscape),
/*Tablet, portrait screen orientation*/
only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : portrait) {
.nav-docs-section li {
width: 50%;
}
}
/* 3 columns layout on tablet (landscape screen orientation) */
@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : landscape) {
.nav-docs-section li {
width: 33%;
}
}
.nav-blog li {
margin-bottom: 5px;
}
@@ -1351,13 +1382,10 @@ div[data-twttr-id] iframe {
}
.survey-image {
position: absolute;
top: 10px;
height: 83px;
width: 120px;
float: left;
height: 128px;
width: 128px;
background-image: url('../img/survey.png');
background-size: 272px 198px;
background-position: -8px -8px;
}
.survey p {
Binary file not shown.

Before

Width:  |  Height:  |  Size: 129 KiB

After

Width:  |  Height:  |  Size: 20 KiB

+12 -3
View File
@@ -8,7 +8,7 @@
function init() {
if (isMobile()) {
document.querySelector('.nav-site-wrapper a[data-target]').addEventListener('click', toggleTargetNav);
document.querySelector('.nav-site-wrapper a[data-target]').addEventListener('click', toggleTarget);
}
var backdrop = document.querySelector('.modal-backdrop');
@@ -46,12 +46,21 @@
modal.classList.remove('modal-open');
}
function toggleTargetNav(event) {
var toggledTarget;
function toggleTarget(event) {
var target = document.body.querySelector(event.target.getAttribute('data-target'));
if (target) {
event.preventDefault();
target.classList.toggle('in');
if (toggledTarget === target) {
toggledTarget.classList.toggle('in');
} else {
toggledTarget && toggledTarget.classList.remove('in');
target.classList.add('in');
}
toggledTarget = target;
}
}