Skip to content

Commit

Permalink
Completing issues #44 and #45
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason Butz committed Jul 19, 2013
1 parent e22fc0e commit 56d3fbf
Show file tree
Hide file tree
Showing 8 changed files with 75 additions and 75 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ build:
@echo "Compiling documentation... ${CHECK} Done"
@./node_modules/.bin/uglifyjs -nc docs/assets/js/bootstrap-lightbox.js > docs/assets/js/bootstrap-lightbox.min.tmp.js

@echo "/*!\n* bootstrap-lightbox.js v0.6.0 \n* Copyright 2013 Jason Butz\n* http://www.apache.org/licenses/LICENSE-2.0.txt\n*/" > docs/assets/js/copyright.js
@echo "/*!\n* bootstrap-lightbox.js v0.6.1 \n* Copyright 2013 Jason Butz\n* http://www.apache.org/licenses/LICENSE-2.0.txt\n*/" > docs/assets/js/copyright.js
@cat docs/assets/js/copyright.js js/bootstrap-lightbox.js > docs/assets/js/bootstrap-lightbox.js
@cat docs/assets/js/copyright.js docs/assets/js/bootstrap-lightbox.min.tmp.js > docs/assets/js/bootstrap-lightbox.min.js
@rm docs/assets/js/copyright.js docs/assets/js/bootstrap-lightbox.min.tmp.js

@echo "/*!\n* bootstrap-lightbox.css v0.6.0 \n* Copyright 2013 Jason Butz\n* http://www.apache.org/licenses/LICENSE-2.0.txt\n*/" > docs/assets/css/copyright.css
@echo "/*!\n* bootstrap-lightbox.css v0.6.1 \n* Copyright 2013 Jason Butz\n* http://www.apache.org/licenses/LICENSE-2.0.txt\n*/" > docs/assets/css/copyright.css
@cat docs/assets/css/copyright.css docs/assets/css/bootstrap-lightbox.css.tmp > docs/assets/css/bootstrap-lightbox.css
@cat docs/assets/css/copyright.css docs/assets/css/bootstrap-lightbox.min.css.tmp > docs/assets/css/bootstrap-lightbox.min.css
@rm docs/assets/css/copyright.css docs/assets/css/bootstrap-lightbox.css.tmp docs/assets/css/bootstrap-lightbox.min.css.tmp
Expand Down
2 changes: 1 addition & 1 deletion docs/assets/css/bootstrap-lightbox.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* bootstrap-lightbox.css v0.6.0
* bootstrap-lightbox.css v0.6.1
* Copyright 2013 Jason Butz
* http://www.apache.org/licenses/LICENSE-2.0.txt
*/
Expand Down
2 changes: 1 addition & 1 deletion docs/assets/css/bootstrap-lightbox.min.css

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

66 changes: 33 additions & 33 deletions docs/assets/js/bootstrap-lightbox.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/*!
* bootstrap-lightbox.js v0.6.0
* bootstrap-lightbox.js v0.6.1
* Copyright 2013 Jason Butz
* http://www.apache.org/licenses/LICENSE-2.0.txt
*/
!function ($) {
"use strict"; // jshint ;_;
"use strict";


/* LIGHTBOX CLASS DEFINITION
Expand Down Expand Up @@ -44,90 +44,90 @@
var that = this,
e = $.Event('show');

this.$element.trigger(e)
this.$element.trigger(e);

if (this.isShown || e.isDefaultPrevented()) return
if (this.isShown || e.isDefaultPrevented()) return;

this.isShown = true;


this.escape()
this.escape();

// This bit is added since we don't display until we have the size
// which prevents image jumping
this.preloadSize(function()
{
that.backdrop(function ()
{
var transition = $.support.transition && that.$element.hasClass('fade')
var transition = $.support.transition && that.$element.hasClass('fade');

if (!that.$element.parent().length)
{
that.$element.appendTo(document.body) //don't move modals dom position
that.$element.appendTo(document.body); //don't move modals dom position
}

that.$element.show()
that.$element.show();

if (transition)
{
that.$element[0].offsetWidth // force reflow
that.$element[0].offsetWidth; // force reflow
}

that.$element
.addClass('in')
.attr('aria-hidden', false)
.attr('aria-hidden', false);

that.enforceFocus()
that.enforceFocus();

transition ?
that.$element.one($.support.transition.end, function () { that.$element.focus().trigger('shown') }) :
that.$element.focus().trigger('shown')
that.$element.focus().trigger('shown');
});
});
};

// We have to have this because of a class in it
Lightbox.prototype.hide = function (e)
{
e && e.preventDefault()
e && e.preventDefault();

var that = this
var that = this;

e = $.Event('hide')
e = $.Event('hide');

this.$element.trigger(e)
this.$element.trigger(e);

if (!this.isShown || e.isDefaultPrevented()) return
if (!this.isShown || e.isDefaultPrevented()) return;

this.isShown = false
this.isShown = false;

this.escape()
this.escape();

$(document).off('focusin.lightbox')
$(document).off('focusin.lightbox');

this.$element
.removeClass('in')
.attr('aria-hidden', true)
.attr('aria-hidden', true);

$.support.transition && this.$element.hasClass('fade') ?
this.hideWithTransition() :
this.hideModal()
this.hideModal();
};

// This references a class as well
Lightbox.prototype.escape = function()
{
var that = this
var that = this;
if (this.isShown && this.options.keyboard)
{
this.$element.on('keyup.dismiss.lightbox', function ( e )
{
e.which == 27 && that.hide()
})
e.which == 27 && that.hide();
});
}
else if (!this.isShown)
{
this.$element.off('keyup.dismiss.lightbox')
this.$element.off('keyup.dismiss.lightbox');
}
}

Expand Down Expand Up @@ -205,7 +205,7 @@
/* LIGHTBOX PLUGIN DEFINITION
* ======================= */

var old = $.fn.lightbox
var old = $.fn.lightbox;

$.fn.lightbox = function (option)
{
Expand All @@ -217,9 +217,9 @@
if (!data) $this.data('lightbox', (data = new Lightbox(this, options)));

if (typeof option == 'string')
data[option]()
data[option]();
else if (options.show)
data.show()
data.show();
});
};

Expand All @@ -235,15 +235,15 @@
* ================= */

$.fn.lightbox.noConflict = function () {
$.fn.lightbox = old
return this
$.fn.lightbox = old;
return this;
}


/* LIGHTBOX DATA-API
* ================== */

$(document).on('click.lightbox.data-api', '[data-toggle="lightbox"]', function (e)
$(document).on('click.lightbox.data-api', '[data-toggle*="lightbox"]', function (e)
{
var $this = $(this);
var href = $this.attr('href');
Expand All @@ -256,7 +256,7 @@
.lightbox(option)
.one('hide', function ()
{
$this.focus()
$this.focus();
});
})

Expand Down
4 changes: 2 additions & 2 deletions docs/assets/js/bootstrap-lightbox.min.js

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

2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ <h1>Bootstrap Lightbox</h1>
<p><a href="assets/bootstrap-lightbox.zip" class="btn btn-primary btn-large">Download Bootstrap Lightbox</a></p>
<ul class="masthead-links">
<li><a href="http://github.com/jbutz/bootstrap-lightbox">GitHub project</a></li>
<li>Version 0.6.0</li>
<li>Version 0.6.1</li>
</ul>
</div>
</div>
Expand Down
64 changes: 32 additions & 32 deletions js/bootstrap-lightbox.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
!function ($) {
"use strict"; // jshint ;_;
"use strict";


/* LIGHTBOX CLASS DEFINITION
Expand Down Expand Up @@ -39,90 +39,90 @@
var that = this,
e = $.Event('show');

this.$element.trigger(e)
this.$element.trigger(e);

if (this.isShown || e.isDefaultPrevented()) return
if (this.isShown || e.isDefaultPrevented()) return;

this.isShown = true;


this.escape()
this.escape();

// This bit is added since we don't display until we have the size
// which prevents image jumping
this.preloadSize(function()
{
that.backdrop(function ()
{
var transition = $.support.transition && that.$element.hasClass('fade')
var transition = $.support.transition && that.$element.hasClass('fade');

if (!that.$element.parent().length)
{
that.$element.appendTo(document.body) //don't move modals dom position
that.$element.appendTo(document.body); //don't move modals dom position
}

that.$element.show()
that.$element.show();

if (transition)
{
that.$element[0].offsetWidth // force reflow
that.$element[0].offsetWidth; // force reflow
}

that.$element
.addClass('in')
.attr('aria-hidden', false)
.attr('aria-hidden', false);

that.enforceFocus()
that.enforceFocus();

transition ?
that.$element.one($.support.transition.end, function () { that.$element.focus().trigger('shown') }) :
that.$element.focus().trigger('shown')
that.$element.focus().trigger('shown');
});
});
};

// We have to have this because of a class in it
Lightbox.prototype.hide = function (e)
{
e && e.preventDefault()
e && e.preventDefault();

var that = this
var that = this;

e = $.Event('hide')
e = $.Event('hide');

this.$element.trigger(e)
this.$element.trigger(e);

if (!this.isShown || e.isDefaultPrevented()) return
if (!this.isShown || e.isDefaultPrevented()) return;

this.isShown = false
this.isShown = false;

this.escape()
this.escape();

$(document).off('focusin.lightbox')
$(document).off('focusin.lightbox');

this.$element
.removeClass('in')
.attr('aria-hidden', true)
.attr('aria-hidden', true);

$.support.transition && this.$element.hasClass('fade') ?
this.hideWithTransition() :
this.hideModal()
this.hideModal();
};

// This references a class as well
Lightbox.prototype.escape = function()
{
var that = this
var that = this;
if (this.isShown && this.options.keyboard)
{
this.$element.on('keyup.dismiss.lightbox', function ( e )
{
e.which == 27 && that.hide()
})
e.which == 27 && that.hide();
});
}
else if (!this.isShown)
{
this.$element.off('keyup.dismiss.lightbox')
this.$element.off('keyup.dismiss.lightbox');
}
}

Expand Down Expand Up @@ -200,7 +200,7 @@
/* LIGHTBOX PLUGIN DEFINITION
* ======================= */

var old = $.fn.lightbox
var old = $.fn.lightbox;

$.fn.lightbox = function (option)
{
Expand All @@ -212,9 +212,9 @@
if (!data) $this.data('lightbox', (data = new Lightbox(this, options)));

if (typeof option == 'string')
data[option]()
data[option]();
else if (options.show)
data.show()
data.show();
});
};

Expand All @@ -230,15 +230,15 @@
* ================= */

$.fn.lightbox.noConflict = function () {
$.fn.lightbox = old
return this
$.fn.lightbox = old;
return this;
}


/* LIGHTBOX DATA-API
* ================== */

$(document).on('click.lightbox.data-api', '[data-toggle="lightbox"]', function (e)
$(document).on('click.lightbox.data-api', '[data-toggle*="lightbox"]', function (e)
{
var $this = $(this);
var href = $this.attr('href');
Expand All @@ -251,7 +251,7 @@
.lightbox(option)
.one('hide', function ()
{
$this.focus()
$this.focus();
});
})

Expand Down
Loading

0 comments on commit 56d3fbf

Please sign in to comment.