Last active
March 8, 2017 06:39
-
-
Save goofmint/3c49043cd562ea1fbe54b9dfa0a77932 to your computer and use it in GitHub Desktop.
1.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function() { | |
var controller = { | |
__name: 'PageController', | |
artboardViewerController: h5.ui.components.artboard.controller.ArtboardViewerController, | |
magnifierController: h5.ui.components.artboard.controller.MagnifierController, | |
__meta: { | |
artboardViewerController: { | |
rootElement: '.loadView' | |
}, | |
magnifierController: { | |
rootElement: '.loadView' | |
} | |
}, | |
mag: null, | |
__ready: function() { | |
this._load(SAMPLE_SAVE_DATA); | |
}, | |
_load: function(saveData) { | |
this.artboardViewerController.load( | |
saveData, | |
this.$find('.loadView').hasClass('fixSize') | |
); | |
this._createMagnifier(); | |
}, | |
_createMagnifier: function() { | |
this.mag = this.magnifierController.createMagnifier( | |
this.$find('.loadView'), { | |
scale: 2, | |
width: 200, | |
height: 200, | |
mouseover: true | |
}); | |
} | |
}; | |
$('.viewer').each(function() { | |
h5.core.controller(this, controller); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment