a zip code crypto-currency system good for red ONLY

tab-highlight.js 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. (function (factory) {
  2. if (typeof module === "object" && typeof module.exports === "object") {
  3. var v = factory(require, exports);
  4. if (v !== undefined) module.exports = v;
  5. }
  6. else if (typeof define === "function" && define.amd) {
  7. define(["require", "exports", "@angular/core", "../../platform/dom-controller"], factory);
  8. }
  9. })(function (require, exports) {
  10. "use strict";
  11. Object.defineProperty(exports, "__esModule", { value: true });
  12. var core_1 = require("@angular/core");
  13. var dom_controller_1 = require("../../platform/dom-controller");
  14. /**
  15. * @hidden
  16. */
  17. var TabHighlight = (function () {
  18. function TabHighlight(_elementRef, _dom) {
  19. this._elementRef = _elementRef;
  20. this._dom = _dom;
  21. }
  22. TabHighlight.prototype.select = function (tab) {
  23. var _this = this;
  24. if (!tab) {
  25. return;
  26. }
  27. var dom = this._dom;
  28. dom.read(function () {
  29. var btnEle = tab.btn.getNativeElement();
  30. var transform = "translate3d(" + btnEle.offsetLeft + "px,0,0) scaleX(" + btnEle.offsetWidth + ")";
  31. dom.write(function () {
  32. var ele = _this._elementRef.nativeElement;
  33. ele.style[dom.plt.Css.transform] = transform;
  34. if (!_this._init) {
  35. _this._init = true;
  36. dom.write(function () {
  37. ele.classList.add('animate');
  38. }, 80);
  39. }
  40. });
  41. }, 32);
  42. };
  43. TabHighlight.decorators = [
  44. { type: core_1.Directive, args: [{
  45. selector: '.tab-highlight'
  46. },] },
  47. ];
  48. /** @nocollapse */
  49. TabHighlight.ctorParameters = function () { return [
  50. { type: core_1.ElementRef, },
  51. { type: dom_controller_1.DomController, },
  52. ]; };
  53. return TabHighlight;
  54. }());
  55. exports.TabHighlight = TabHighlight;
  56. });
  57. //# sourceMappingURL=tab-highlight.js.map