I have a new project based on construction. Here we will have huge image sets of building architecture and engineering diagrams.
This is my small plunker link attempt trying to do so.
I do not know if this is possible, I want to click on different section of image, create tag and have comment thread based on those tags.
May someone help me to get the popover just next to cursor where mouse is clicked on top of image. Tags created will be for that section and next time any user wants to preview can mouse over to the image and see tags as tool-tips then follow the comment thread for that tag.
I have tried with angular but Jquery or any other js framework is fine as long as it works.
<body ng-controller="MainCtrl">
<br>
<div class='container-fluid'>
<div class='alert alert-info'>
<h4>Click the image and tag</h4>
</div>
<div class='row'>
<div class='col-lg-11'>
<div class='col-sm-11 ' >
<img tagover src='http://www.studioats.com/wp-content/uploads/2011/05/A2-1A-First-Floor-Plan-Area-A-12x18.jpg' height='300' width='500' />
</div>
<div class='col-sm-3 well' >
<p><span class='label label-info'>Comments</span> {{tagName}}</p>
<textarea class='form-control' placeholder='comments here'></textarea>
</div>
</div>
</div>
</div>
Script
var app = angular.module('plunker', []);
app.controller('MainCtrl', function($scope) {
});
app.directive('tagover', function ($compile,$templateCache,$interpolate) {
var getTemplate = function (contentType,attrs) {
var template = '';
switch (contentType) {
case 'comment':
var template = "<div class='' >";
template += "<input class='form-control' type='text' ng-model='tagName' placeholder='tag name'>";
template += "</div>";
template += "</div>";
break;
}
return template;
} //
return {
restrict: "A",
link: function (scope, element, attrs) {
var popOverContent;
var d = new Date();
var mm = d.getMonth()+1;
popOverContent = getTemplate("comment",attrs);
var compiled = $compile(popOverContent)(scope);
var options = {
content: compiled,
placement: "bottom",
html: true,
date: scope.date
};
$(element).popover(options);
}
};
});