Browse Source

Prevent errors in dimsFromTarget with empty target

pull/187/head
Artur Arseniev 9 years ago
parent
commit
789c870568
  1. 90
      index.html
  2. 4
      src/utils/Sorter.js

90
index.html

@ -813,96 +813,6 @@
display:none;
}
}
.nav-items {
display: inline-block;
float: right;
}
.navbar {
background-color: #222;
color: #ddd;
min-height: 50px;
width: 100%;
}
.navbar-container {
max-width: 950px;
margin: 0 auto;
width: 95%;
}
.navbar-container::after {
content: "";
clear: both;
display: block;
}
.navbar-brand {
vertical-align: top;
display: inline-block;
padding: 5px;
min-height: 50px;
min-width: 50px;
color: inherit;
text-decoration: none;
}
.navbar-items {
padding: 10px 0;
display: block;
float: right;
margin: 0;
}
.navbar-item {
margin: 0;
color: inherit;
text-decoration: none;
display: inline-block;
padding: 10px 15px;
}
.burger {
margin: 10px 0;
width: 45px;
padding: 5px 10px;
display: none;
float: right;
cursor: pointer;
}
.burger-line {
padding: 1px;
background-color: white;
margin: 5px 0;
}
@media (max-width: 768px) {
.burger {
display: block;
}
.nav-items {
display: none;
width: 100%;
}
.navbar-items {
width: 100%;
}
.navbar-item {
display: block;
}
}
</style>
</div>

4
src/utils/Sorter.js

@ -484,6 +484,10 @@ module.exports = Backbone.View.extend({
dimsFromTarget(target, rX, rY) {
var dims = [];
if (!target) {
return dims;
}
// Select the first valuable target
if (!target.matches(`${this.itemSel}, ${this.containerSel}`)) {
target = this.closest(target, this.itemSel);

Loading…
Cancel
Save