更新一下编辑按钮位置纠正的timer
This commit is contained in:
parent
15b5487743
commit
8c2f168826
|
|
@ -182,9 +182,10 @@ app.controller('bookmarksCtr', ['$scope', '$state', '$stateParams', '$filter', '
|
|||
|
||||
// TODO: 我要将编辑按钮固定在容器的右上角
|
||||
$(window).resize(updateEditPos);
|
||||
setTimeout(updateEditPos, 100);
|
||||
updateEditPos();
|
||||
|
||||
function updateEditPos() {
|
||||
for(var i=1; i<=10; i++){
|
||||
setTimeout(function() {
|
||||
if ($scope.showStyl == 'navigate') {
|
||||
var t = $('.js-segment-navigate').offset().top;
|
||||
|
|
@ -196,6 +197,7 @@ app.controller('bookmarksCtr', ['$scope', '$state', '$stateParams', '$filter', '
|
|||
left: l + w - 10,
|
||||
})
|
||||
}
|
||||
}, 100)
|
||||
}, 100 * i)
|
||||
}
|
||||
}
|
||||
}]);
|
||||
|
|
|
|||
|
|
@ -317,12 +317,10 @@ app.controller('tagsCtr', ['$scope', '$filter', '$window', '$stateParams', '$tim
|
|||
|
||||
// TODO: 我要将编辑按钮固定在容器的右上角
|
||||
$(window).resize(updateEditPos);
|
||||
setTimeout(updateEditPos, 100);
|
||||
setTimeout(updateEditPos, 500);
|
||||
setTimeout(updateEditPos, 1000);
|
||||
setTimeout(updateEditPos, 10000);
|
||||
updateEditPos();
|
||||
|
||||
function updateEditPos() {
|
||||
for (var i = 1; i <= 10; i++) {
|
||||
setTimeout(function() {
|
||||
var t = $('.js-tags').offset().top;
|
||||
var l = $('.js-tags').offset().left;
|
||||
|
|
@ -332,7 +330,8 @@ app.controller('tagsCtr', ['$scope', '$filter', '$window', '$stateParams', '$tim
|
|||
top: t + 10,
|
||||
left: l + w - 10,
|
||||
})
|
||||
}, 100)
|
||||
}, 100 * i)
|
||||
}
|
||||
}
|
||||
|
||||
}]);
|
||||
|
|
|
|||
Loading…
Reference in New Issue