3
0
mirror of https://github.com/cytodev/LightDMMock.git synced 2024-11-24 15:13:40 +01:00

Adds a safety check.

This commit is contained in:
CytoDev 2016-07-12 23:05:10 +02:00
parent 1613e868c2
commit de77e4a072
2 changed files with 8 additions and 2 deletions

View File

@ -11,7 +11,10 @@
* Include the file in your theme that needs mocking
* <script type="text/javascript" src="mock/LightDMMock.js"></script>
* Create a new instance of LightDMMock
* var lightdm = lightdm || new LightDMMock(autofill, timeout, autoGuest);
* if(!("lightdm" in window)) {
* var LightDMMock = LightDMMock || {};
* window.lightdm = new LightDMMock(autofill, timeout, autoGuest);
* }
*
* @param {boolean} autofill [wether or not the arrays for users, languages,
* layouts, and sessions need to be filled with mock

View File

@ -12,7 +12,10 @@ git clone git@github.com:CytoDev/LightDMMock.git
````
3. Create a new instance of LightDMMock
````javascript
var lightdm = lightdm || new LightDMMock(autofill, timeout, autoGuest);
if(!("lightdm" in window)) {
var LightDMMock = LightDMMock || {};
window.lightdm = new LightDMMock(autofill, timeout, autoGuest);
}
````
##Parameters of LightDMMock()