Skip to content

Commit

Permalink
Merge pull request #37 from piccard21/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
piccard21 authored Jan 6, 2018
2 parents 1a2a186 + 279b673 commit 7826921
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 42 deletions.
2 changes: 1 addition & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ typings/
*.sublime-project
*.sublime-workspace
.idea/
.docs/
docs
25 changes: 13 additions & 12 deletions dist/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -532,20 +532,21 @@ function busyLoadSetup(settings) {
}

function busyLoad(action, options) {
var bl = new _classBusyLoad.BusyLoad(this, JSON.parse(JSON.stringify(_defaults2.default)), options);

switch (action) {
case "show":
bl.show();
break;
case "hide":
bl.hide();
break;
default:
throw 'don\'t know action \'' + action + '\'';
}
return this.each(function () {
var bl = new _classBusyLoad.BusyLoad($(this), JSON.parse(JSON.stringify(_defaults2.default)), options);

return this;
switch (action) {
case "show":
bl.show();
break;
case "hide":
bl.hide();
break;
default:
throw 'don\'t know action \'' + action + '\'';
}
});
}

function busyLoadFull(action, options) {
Expand Down
2 changes: 1 addition & 1 deletion dist/app.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "busy-load",
"version": "0.1.0",
"version": "0.1.1",
"description": "A flexible jQuery loading-mask",
"main": "src/index.js",
"scripts": {
Expand Down
53 changes: 27 additions & 26 deletions src/lib/busy-load.js
Original file line number Diff line number Diff line change
@@ -1,55 +1,56 @@
import { BusyLoad } from './class.BusyLoad.js';
import defaults from './defaults.js';
import {BusyLoad} from './class.BusyLoad.js';
import defaults from './defaults.js';


export function busyLoadSetup(settings) {
export function busyLoadSetup(settings) {
$.extend(true, defaults, settings);
}


export function busyLoad(action, options) {
let bl = new BusyLoad(this, JSON.parse(JSON.stringify(defaults)), options);

switch (action) {
case "show":
bl.show();
break;
case "hide":
bl.hide();
break;
default:
throw `don't know action '${action}'`
}

return this;
export function busyLoad(action, options) {

return this.each(function () {
let bl = new BusyLoad($(this), JSON.parse(JSON.stringify(defaults)), options);

switch (action) {
case "show":
bl.show();
break;
case "hide":
bl.hide();
break;
default:
throw `don't know action '${action}'`
}
});
}


export function busyLoadFull(action, options) {
export function busyLoadFull(action, options) {

let $body = $('body');
let bl = new BusyLoad($body, JSON.parse(JSON.stringify(defaults)), options);


switch (action.toLowerCase()) {
case "show":
$body.addClass("no-scroll");
$body.addClass("no-scroll");
bl.caller = $body;
bl.extendSettings({
fullScreen: true
});
bl.show();

break;

case "hide":
bl.hide();
$body.removeClass("no-scroll");
$body.removeClass("no-scroll");
break;
}

return $body;

}


10 changes: 10 additions & 0 deletions test/test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion test/testrunner.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<link href="../node_modules/mocha/mocha.css" rel="stylesheet"/>
</meta>
<style type="text/css">
#maskme {
#maskme, .maskme {
display: block;
position: relative;
}
Expand All @@ -16,6 +16,16 @@
</div>
<div id="maskme">
</div>
<div>
<div class="maskme">
</div>
<div class="maskme">
</div>
<div class="maskme">
</div>
<div class="maskme">
</div>
</div>
<script src="../node_modules/mocha/mocha.js">
</script>
<script src="../node_modules/chai/chai.js">
Expand Down

0 comments on commit 7826921

Please sign in to comment.