Skip to content

Commit

Permalink
[*] BO : updated bootstrap to latest version
Browse files Browse the repository at this point in the history
  • Loading branch information
Shipow committed Jun 13, 2014
1 parent c69daec commit 37260df
Show file tree
Hide file tree
Showing 76 changed files with 1,623 additions and 1,165 deletions.
6 changes: 3 additions & 3 deletions admin-dev/themes/default/bower.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "prestashop-admin",
"version": "1.6.0",
"version": "1.6.7",
"dependencies": {
"font-awesome": "4.0.3",
"bootstrap-sass-official": "3.1.1",
"font-awesome": "4.1",
"bootstrap-sass-official": "3.1.1+2",
"enquire": "2.1.0"
},
"devDependencies": {}
Expand Down
2 changes: 1 addition & 1 deletion admin-dev/themes/default/css/admin-theme.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion admin-dev/themes/default/css/admin-theme_rtl.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion admin-dev/themes/default/css/schemes/admin-theme-blue.css

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion admin-dev/themes/default/css/schemes/admin-theme-flex.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion admin-dev/themes/default/css/schemes/admin-theme-fruit.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion admin-dev/themes/default/css/schemes/admin-theme-prune.css

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

6 changes: 2 additions & 4 deletions admin-dev/themes/default/js/vendor/bootstrap/affix.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@
var offsetTop = offset.top
var offsetBottom = offset.bottom

if (this.affixed == 'top') position.top += scrollTop

if (typeof offset != 'object') offsetBottom = offsetTop = offset
if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element)
if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element)
Expand All @@ -66,7 +64,7 @@
offsetTop != null && (scrollTop <= offsetTop) ? 'top' : false

if (this.affixed === affix) return
if (this.unpin) this.$element.css('top', '')
if (this.unpin != null) this.$element.css('top', '')

var affixType = 'affix' + (affix ? '-' + affix : '')
var e = $.Event(affixType + '.bs.affix')
Expand All @@ -84,7 +82,7 @@
.trigger($.Event(affixType.replace('affix', 'affixed')))

if (affix == 'bottom') {
this.$element.offset({ top: scrollHeight - offsetBottom - this.$element.height() })
this.$element.offset({ top: position.top })
}
}

Expand Down
2 changes: 1 addition & 1 deletion admin-dev/themes/default/js/vendor/bootstrap/button.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
// BUTTON DATA-API
// ===============

$(document).on('click.bs.button.data-api', '[data-toggle^=button]', function (e) {
$(document).on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) {
var $btn = $(e.target)
if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
$btn.button('toggle')
Expand Down
10 changes: 5 additions & 5 deletions admin-dev/themes/default/js/vendor/bootstrap/carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@

Carousel.prototype.getActiveIndex = function () {
this.$active = this.$element.find('.item.active')
this.$items = this.$active.parent().children()
this.$items = this.$active.parent().children('.item')

return this.$items.index(this.$active)
}
Expand All @@ -59,7 +59,7 @@

if (pos > (this.$items.length - 1) || pos < 0) return

if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) })
if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) // yes, "slid". not a typo. past tense of "to slide".
if (activeIndex == pos) return this.pause().cycle()

return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos]))
Expand Down Expand Up @@ -113,7 +113,7 @@

if (this.$indicators.length) {
this.$indicators.find('.active').removeClass('active')
this.$element.one('slid.bs.carousel', function () {
this.$element.one('slid.bs.carousel', function () { // yes, "slid". not a typo. past tense of "to slide".
var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()])
$nextIndicator && $nextIndicator.addClass('active')
})
Expand All @@ -129,14 +129,14 @@
$next.removeClass([type, direction].join(' ')).addClass('active')
$active.removeClass(['active', direction].join(' '))
that.sliding = false
setTimeout(function () { that.$element.trigger('slid.bs.carousel') }, 0)
setTimeout(function () { that.$element.trigger('slid.bs.carousel') }, 0) // yes, "slid". not a typo. past tense of "to slide".
})
.emulateTransitionEnd($active.css('transition-duration').slice(0, -1) * 1000)
} else {
$active.removeClass('active')
$next.addClass('active')
this.sliding = false
this.$element.trigger('slid.bs.carousel')
this.$element.trigger('slid.bs.carousel') // yes, "slid". not a typo. past tense of "to slide".
}

isCycling && this.cycle()
Expand Down
31 changes: 18 additions & 13 deletions admin-dev/themes/default/js/vendor/bootstrap/collapse.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,19 @@

this.$element
.removeClass('collapse')
.addClass('collapsing')
[dimension](0)
.addClass('collapsing')[dimension](0)

this.transitioning = 1

var complete = function () {
var complete = function (e) {
if (e && e.target != this.$element[0]) {
this.$element
.one($.support.transition.end, $.proxy(complete, this))
return
}
this.$element
.removeClass('collapsing')
.addClass('collapse in')
[dimension]('auto')
.addClass('collapse in')[dimension]('')
this.transitioning = 0
this.$element.trigger('shown.bs.collapse')
}
Expand All @@ -71,8 +74,7 @@

this.$element
.one($.support.transition.end, $.proxy(complete, this))
.emulateTransitionEnd(350)
[dimension](this.$element[0][scrollSize])
.emulateTransitionEnd(350)[dimension](this.$element[0][scrollSize])
}

Collapse.prototype.hide = function () {
Expand All @@ -84,9 +86,7 @@

var dimension = this.dimension()

this.$element
[dimension](this.$element[dimension]())
[0].offsetHeight
this.$element[dimension](this.$element[dimension]())[0].offsetHeight

this.$element
.addClass('collapsing')
Expand All @@ -95,7 +95,12 @@

this.transitioning = 1

var complete = function () {
var complete = function (e) {
if (e && e.target != this.$element[0]) {
this.$element
.one($.support.transition.end, $.proxy(complete, this))
return
}
this.transitioning = 0
this.$element
.trigger('hidden.bs.collapse')
Expand Down Expand Up @@ -148,7 +153,7 @@
// COLLAPSE DATA-API
// =================

$(document).on('click.bs.collapse.data-api', '[data-toggle=collapse]', function (e) {
$(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) {
var $this = $(this), href
var target = $this.attr('data-target')
|| e.preventDefault()
Expand All @@ -160,7 +165,7 @@
var $parent = parent && $(parent)

if (!data || !data.transitioning) {
if ($parent) $parent.find('[data-toggle=collapse][data-parent="' + parent + '"]').not($this).addClass('collapsed')
if ($parent) $parent.find('[data-toggle="collapse"][data-parent="' + parent + '"]').not($this).addClass('collapsed')
$this[$target.hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
}

Expand Down
17 changes: 9 additions & 8 deletions admin-dev/themes/default/js/vendor/bootstrap/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// =========================

var backdrop = '.dropdown-backdrop'
var toggle = '[data-toggle=dropdown]'
var toggle = '[data-toggle="dropdown"]'
var Dropdown = function (element) {
$(element).on('click.bs.dropdown', this.toggle)
}
Expand All @@ -40,11 +40,11 @@

if (e.isDefaultPrevented()) return

$this.trigger('focus')

$parent
.toggleClass('open')
.trigger('shown.bs.dropdown', relatedTarget)

$this.focus()
}

return false
Expand All @@ -64,12 +64,12 @@
var isActive = $parent.hasClass('open')

if (!isActive || (isActive && e.keyCode == 27)) {
if (e.which == 27) $parent.find(toggle).focus()
return $this.click()
if (e.which == 27) $parent.find(toggle).trigger('focus')
return $this.trigger('click')
}

var desc = ' li:not(.divider):visible a'
var $items = $parent.find('[role=menu]' + desc + ', [role=listbox]' + desc)
var $items = $parent.find('[role="menu"]' + desc + ', [role="listbox"]' + desc)

if (!$items.length) return

Expand All @@ -79,10 +79,11 @@
if (e.keyCode == 40 && index < $items.length - 1) index++ // down
if (!~index) index = 0

$items.eq(index).focus()
$items.eq(index).trigger('focus')
}

function clearMenus(e) {
if (e && e.which === 3) return
$(backdrop).remove()
$(toggle).each(function () {
var $parent = getParent($(this))
Expand Down Expand Up @@ -142,6 +143,6 @@
.on('click.bs.dropdown.data-api', clearMenus)
.on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
.on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle)
.on('keydown.bs.dropdown.data-api', toggle + ', [role=menu], [role=listbox]', Dropdown.prototype.keydown)
.on('keydown.bs.dropdown.data-api', toggle + ', [role="menu"], [role="listbox"]', Dropdown.prototype.keydown)

}(jQuery);
68 changes: 50 additions & 18 deletions admin-dev/themes/default/js/vendor/bootstrap/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@
// ======================

var Modal = function (element, options) {
this.options = options
this.$element = $(element)
this.$backdrop =
this.isShown = null
this.options = options
this.$body = $(document.body)
this.$element = $(element)
this.$backdrop =
this.isShown = null
this.scrollbarWidth = 0

if (this.options.remote) {
this.$element
Expand All @@ -35,7 +37,7 @@
}

Modal.prototype.toggle = function (_relatedTarget) {
return this[!this.isShown ? 'show' : 'hide'](_relatedTarget)
return this.isShown ? this.hide() : this.show(_relatedTarget)
}

Modal.prototype.show = function (_relatedTarget) {
Expand All @@ -48,6 +50,10 @@

this.isShown = true

this.checkScrollbar()
this.$body.addClass('modal-open')

this.setScrollbar()
this.escape()

this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
Expand All @@ -56,7 +62,7 @@
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(that.$body) // don't move modals dom position
}

that.$element
Expand All @@ -78,10 +84,10 @@
transition ?
that.$element.find('.modal-dialog') // wait for modal to slide in
.one($.support.transition.end, function () {
that.$element.focus().trigger(e)
that.$element.trigger('focus').trigger(e)
})
.emulateTransitionEnd(300) :
that.$element.focus().trigger(e)
that.$element.trigger('focus').trigger(e)
})
}

Expand All @@ -96,6 +102,9 @@

this.isShown = false

this.$body.removeClass('modal-open')

this.resetScrollbar()
this.escape()

$(document).off('focusin.bs.modal')
Expand All @@ -117,7 +126,7 @@
.off('focusin.bs.modal') // guard against infinite focus loop
.on('focusin.bs.modal', $.proxy(function (e) {
if (this.$element[0] !== e.target && !this.$element.has(e.target).length) {
this.$element.focus()
this.$element.trigger('focus')
}
}, this))
}
Expand All @@ -136,7 +145,6 @@
var that = this
this.$element.hide()
this.backdrop(function () {
that.removeBackdrop()
that.$element.trigger('hidden.bs.modal')
})
}
Expand All @@ -147,13 +155,14 @@
}

Modal.prototype.backdrop = function (callback) {
var that = this
var animate = this.$element.hasClass('fade') ? 'fade' : ''

if (this.isShown && this.options.backdrop) {
var doAnimate = $.support.transition && animate

this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
.appendTo(document.body)
.appendTo(this.$body)

this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) {
if (e.target !== e.currentTarget) return
Expand All @@ -177,17 +186,44 @@
} else if (!this.isShown && this.$backdrop) {
this.$backdrop.removeClass('in')

var callbackRemove = function() {
that.removeBackdrop()
callback && callback()
}
$.support.transition && this.$element.hasClass('fade') ?
this.$backdrop
.one($.support.transition.end, callback)
.one($.support.transition.end, callbackRemove)
.emulateTransitionEnd(150) :
callback()
callbackRemove()

} else if (callback) {
callback()
}
}

Modal.prototype.checkScrollbar = function () {
if (document.body.clientWidth >= window.innerWidth) return
this.scrollbarWidth = this.scrollbarWidth || this.measureScrollbar()
}

Modal.prototype.setScrollbar = function () {
var bodyPad = parseInt(this.$body.css('padding-right') || 0)
if (this.scrollbarWidth) this.$body.css('padding-right', bodyPad + this.scrollbarWidth)
}

Modal.prototype.resetScrollbar = function () {
this.$body.css('padding-right', '')
}

Modal.prototype.measureScrollbar = function () { // thx walsh
var scrollDiv = document.createElement('div')
scrollDiv.className = 'modal-scrollbar-measure'
this.$body.append(scrollDiv)
var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth
this.$body[0].removeChild(scrollDiv)
return scrollbarWidth
}


// MODAL PLUGIN DEFINITION
// =======================
Expand Down Expand Up @@ -232,12 +268,8 @@
$target
.modal(option, this)
.one('hide', function () {
$this.is(':visible') && $this.focus()
$this.is(':visible') && $this.trigger('focus')
})
})

$(document)
.on('show.bs.modal', '.modal', function () { $(document.body).addClass('modal-open') })
.on('hidden.bs.modal', '.modal', function () { $(document.body).removeClass('modal-open') })

}(jQuery);
Loading

0 comments on commit 37260df

Please sign in to comment.